diff -r 9986ec0e559a -r 10516539f238 Utilities/ClassBrowsers/pyclbr.py --- a/Utilities/ClassBrowsers/pyclbr.py Tue Oct 15 22:03:54 2013 +0200 +++ b/Utilities/ClassBrowsers/pyclbr.py Fri Oct 18 23:00:41 2013 +0200 @@ -207,7 +207,7 @@ def readmodule_ex(module, path=[], inpackage=False, isPyFile=False): - ''' + """ Read a module file and return a dictionary of classes. Search for MODULE in PATH and sys.path, read and parse the @@ -217,8 +217,9 @@ @param module name of the module file (string) @param path path the module should be searched in (list of strings) @param inpackage flag indicating a module inside a package is scanned + @param isPyFile flag indicating a Python file (boolean) @return the resulting dictionary - ''' + """ global _modules dict = {} @@ -342,7 +343,8 @@ file, lineno, meth_sig, modifierType=modifier) if meth_name in dict_counts: dict_counts[meth_name] += 1 - meth_name = "{0}_{1:d}".format(meth_name, dict_counts[meth_name]) + meth_name = "{0}_{1:d}".format( + meth_name, dict_counts[meth_name]) else: dict_counts[meth_name] = 0 dict[meth_name] = f @@ -408,7 +410,8 @@ if not classstack: if class_name in dict_counts: dict_counts[class_name] += 1 - class_name = "{0}_{1:d}".format(class_name, dict_counts[class_name]) + class_name = "{0}_{1:d}".format( + class_name, dict_counts[class_name]) else: dict_counts[class_name] = 0 dict[class_name] = cur_class @@ -427,7 +430,8 @@ while index >= -len(classstack): if classstack[index][0] is not None and \ not isinstance(classstack[index][0], Function): - attr = Attribute(module, m.group("AttributeName"), file, lineno) + attr = Attribute( + module, m.group("AttributeName"), file, lineno) classstack[index][0]._addattribute(attr) break else: @@ -441,8 +445,8 @@ if thisindent == 0: # global variable if "@@Globals@@" not in dict: - dict["@@Globals@@"] = \ - ClbrBaseClasses.ClbrBase(module, "Globals", file, lineno) + dict["@@Globals@@"] = ClbrBaseClasses.ClbrBase( + module, "Globals", file, lineno) dict["@@Globals@@"]._addglobal( Attribute(module, variable_name, file, lineno)) if lastGlobalEntry: @@ -483,7 +487,8 @@ lineno = lineno + src.count('\n', last_lineno_pos, start) last_lineno_pos = start if "@@Coding@@" not in dict: - dict["@@Coding@@"] = ClbrBaseClasses.Coding(module, file, lineno, coding) + dict["@@Coding@@"] = ClbrBaseClasses.Coding( + module, file, lineno, coding) else: assert 0, "regexp _getnext found something unexpected"