eric6/Utilities/ModuleParser.py

changeset 7249
0bf517e60f54
parent 7229
53054eb5b15a
child 7259
7c017076c12e
equal deleted inserted replaced
7248:60b48ab891fa 7249:0bf517e60f54
778 classstack[index][0].addGlobal( 778 classstack[index][0].addGlobal(
779 variable_name, attr) 779 variable_name, attr)
780 break 780 break
781 781
782 elif m.start("Import") >= 0: 782 elif m.start("Import") >= 0:
783 # import module 783 ## import module
784 names = [n.strip() for n in 784 names = [n.strip() for n in
785 "".join(m.group("ImportList").splitlines()) 785 "".join(m.group("ImportList").splitlines())
786 .replace("\\", "").split(',')] 786 .replace("\\", "").split(',')]
787 self.imports.extend( 787 self.imports.extend(
788 [name for name in names 788 [name for name in names
789 if name not in self.imports]) 789 if name not in self.imports])
790 790
791 elif m.start("ImportFrom") >= 0: 791 elif m.start("ImportFrom") >= 0:
792 # from module import stuff 792 ## from module import stuff
793 mod = m.group("ImportFromPath") 793 mod = m.group("ImportFromPath")
794 namesLines = (m.group("ImportFromList") 794 namesLines = (m.group("ImportFromList")
795 .replace("(", "").replace(")", "") 795 .replace("(", "").replace(")", "")
796 .replace("\\", "") 796 .replace("\\", "")
797 .strip().splitlines()) 797 .strip().splitlines())

eric ide

mercurial