Lines Matching refs:self

63     def __init__(self, src, include_function_definition=True, quiet=False):  argument
73 self.my_dir = os.path.dirname(f.name)
74 self.xmldoc = minidom.parse(f).documentElement
77 self.pieces = []
78 self.pieces.append('\n// File: %s\n' %
81 self.space_re = re.compile(r'\s+')
82 self.lead_spc = re.compile(r'^(%feature\S+\s+\S+\s*?)"\s+(\S)')
83 self.multi = 0
84 self.ignores = ['inheritancegraph', 'param', 'listofallmembers',
92 self.include_function_definition = include_function_definition
94 self.ignores.append('argsstring')
96 self.quiet = quiet
98 def generate(self): argument
103 self.parse(self.xmldoc)
105 def parse(self, node): argument
111 pm = getattr(self, "parse_%s" % node.__class__.__name__)
114 def parse_Document(self, node): argument
115 self.parse(node.documentElement)
117 def parse_Text(self, node): argument
122 m = self.space_re.match(txt)
126 self.add_text(textwrap.fill(txt, break_long_words=False))
128 def parse_Element(self, node): argument
136 ignores = self.ignores
140 if hasattr(self, attr):
141 handlerMethod = getattr(self, attr)
144 self.generic_parse(node)
147 def parse_Comment(self, node): argument
151 def add_text(self, value): argument
154 self.pieces.extend(value)
156 self.pieces.append(value)
158 def get_specific_nodes(self, node, names): argument
169 def generic_parse(self, node, pad=0): argument
185 npiece = len(self.pieces)
187 self.add_text('\n')
189 self.parse(n)
191 if len(self.pieces) > npiece:
192 self.add_text('\n')
194 def space_parse(self, node): argument
195 self.add_text(' ')
196 self.generic_parse(node)
204 def do_compoundname(self, node): argument
205 self.add_text('\n\n')
207 self.add_text('%%feature("docstring") %s "\n' % data)
209 def do_compounddef(self, node): argument
217 first = self.get_specific_nodes(node, names)
220 self.parse(first[n])
221 self.add_text(['";', '\n'])
224 self.parse(n)
228 self.parse(n)
230 def do_includes(self, node): argument
231 self.add_text('C++ includes: ')
232 self.generic_parse(node, pad=1)
234 def do_parameterlist(self, node): argument
247 self.add_text(['\n', '\n', text, ':', '\n'])
248 self.generic_parse(node, pad=1)
250 def do_para(self, node): argument
251 self.add_text('\n')
252 self.generic_parse(node, pad=1)
254 def do_parametername(self, node): argument
255 self.add_text('\n')
261 self.add_text(data)
263 self.add_text("%s: " % data)
265 def do_parameterdefinition(self, node): argument
266 self.generic_parse(node, pad=1)
268 def do_detaileddescription(self, node): argument
269 self.generic_parse(node, pad=1)
271 def do_briefdescription(self, node): argument
272 self.generic_parse(node, pad=1)
274 def do_memberdef(self, node): argument
283 first = self.get_specific_nodes(node, ('definition', 'name'))
292 if self.include_function_definition:
296 self.add_text('\n')
297 self.add_text('%feature("docstring") ')
306 self.add_text(' %s::%s "\n%s' % (ns, name, defn))
308 self.add_text(' %s "\n%s' % (name, defn))
313 self.add_text(' %s::%s "\n%s' % (cname, name, defn))
317 self.parse(n)
318 self.add_text(['";', '\n'])
320 def do_definition(self, node): argument
322 self.add_text('%s "\n%s' % (data, data))
324 def do_sectiondef(self, node): argument
327 self.generic_parse(node)
329 def do_header(self, node): argument
334 self.add_text('\n/*\n %s \n*/\n' % data)
344 self.add_text('\n/*')
345 self.generic_parse(nd)
346 self.add_text('\n*/\n')
348 def do_simplesect(self, node): argument
353 self.add_text(['\n', 'WARNING: '])
354 self.generic_parse(node)
356 self.add_text('\n')
357 self.add_text('See: ')
358 self.generic_parse(node)
360 self.generic_parse(node)
362 def do_argsstring(self, node): argument
363 self.generic_parse(node, pad=1)
365 def do_member(self, node): argument
369 self.generic_parse(node)
371 def do_doxygenindex(self, node): argument
372 self.multi = 1
378 fname = os.path.join(self.my_dir, fname)
379 if not self.quiet:
381 p = Doxy2SWIG(fname, self.include_function_definition, self.quiet)
383 self.pieces.extend(self.clean_pieces(p.pieces))
385 def write(self, fname): argument
387 if self.multi:
388 o.write("".join(x.encode('utf-8') for x in self.pieces))
390 o.write("".join(self.clean_pieces(self.pieces)))
393 def clean_pieces(self, pieces): argument
424 _tmp = self.lead_spc.sub(r'\1"\2', _tmp)