11:b0996e4a289e | 12:1d8dd9706f46 |
---|---|
16 import os | 16 import os |
17 import re | 17 import re |
18 | 18 |
19 import Utilities | 19 import Utilities |
20 import Utilities.ClassBrowsers as ClassBrowsers | 20 import Utilities.ClassBrowsers as ClassBrowsers |
21 import ClbrBaseClasses | 21 from . import ClbrBaseClasses |
22 | 22 |
23 SUPPORTED_TYPES = [ClassBrowsers.IDL_SOURCE] | 23 SUPPORTED_TYPES = [ClassBrowsers.IDL_SOURCE] |
24 | 24 |
25 _getnext = re.compile(r""" | 25 _getnext = re.compile(r""" |
26 (?P<String> | 26 (?P<String> |
196 return dict | 196 return dict |
197 | 197 |
198 _modules[module] = dict | 198 _modules[module] = dict |
199 classstack = [] # stack of (class, indent) pairs | 199 classstack = [] # stack of (class, indent) pairs |
200 indent = 0 | 200 indent = 0 |
201 src = Utilities.decode(f.read())[0] | 201 src = f.read() |
202 f.close() | 202 f.close() |
203 | 203 |
204 lineno, last_lineno_pos = 1, 0 | 204 lineno, last_lineno_pos = 1, 0 |
205 i = 0 | 205 i = 0 |
206 while 1: | 206 while True: |
207 m = _getnext(src, i) | 207 m = _getnext(src, i) |
208 if not m: | 208 if not m: |
209 break | 209 break |
210 start, i = m.span() | 210 start, i = m.span() |
211 | 211 |
234 # else it's a nested def | 234 # else it's a nested def |
235 else: | 235 else: |
236 # it's a function | 236 # it's a function |
237 f = Function(module, meth_name, | 237 f = Function(module, meth_name, |
238 file, lineno, meth_sig) | 238 file, lineno, meth_sig) |
239 if dict_counts.has_key(meth_name): | 239 if meth_name in dict_counts: |
240 dict_counts[meth_name] += 1 | 240 dict_counts[meth_name] += 1 |
241 meth_name = "%s_%d" % (meth_name, dict_counts[meth_name]) | 241 meth_name = "%s_%d" % (meth_name, dict_counts[meth_name]) |
242 else: | 242 else: |
243 dict_counts[meth_name] = 0 | 243 dict_counts[meth_name] = 0 |
244 dict[meth_name] = f | 244 dict[meth_name] = f |