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()) |