diff -r 38d4a35aa308 -r f21bedbb0c6f Utilities/ModuleParser.py --- a/Utilities/ModuleParser.py Sun Oct 02 12:38:58 2011 +0200 +++ b/Utilities/ModuleParser.py Sun Oct 02 15:57:38 2011 +0200 @@ -143,20 +143,20 @@ | (?P<Import> ^ (?: import | from [ \t]+ \. [ \t]+ import ) [ \t]+ - (?P<ImportList> [^#;\n]+ ) + (?P<ImportList> (?: [^#;\\\n]+ (?: \\\n )* )* ) ) | (?P<ImportFrom> ^ from [ \t]+ (?P<ImportFromPath> - \w+ + \.* \w+ (?: [ \t]* \. [ \t]* \w+ )* ) [ \t]+ import [ \t]+ - (?P<ImportFromList> [^#;\n]+ ) + (?P<ImportFromList> (?: [^#;\\\n]+ (?: \\\n )* )* ) ) | (?P<ConditionalDefine> @@ -706,20 +706,20 @@ elif m.start("Import") >= 0: # import module - for name in m.group("ImportList").split(','): - name = name.strip() + names = [n.strip() for n in "".join( + m.group("ImportList").splitlines()).replace("\\", "").split(',')] + for name in names: if not name in self.imports: self.imports.append(name) elif m.start("ImportFrom") >= 0: # from module import stuff mod = m.group("ImportFromPath") - names = m.group("ImportFromList").split(',') + names = [n.strip() for n in "".join( + m.group("ImportFromList").splitlines()).replace("\\", "").split(',')] if mod not in self.from_imports: self.from_imports[mod] = [] - for n in names: - n = n.strip() - self.from_imports[mod].append(n) + self.from_imports[mod].extend(names) elif m.start("ConditionalDefine") >= 0: # a conditional function/method definition