Example #1
0
    def load_existing_modules(self):
        for(dirpath, dirnames, filenames) in os.walk(self.workspace):
            print("load existing modules")
            for file in filenames:
                if(file[-2:] == "py"):
                    abs_path = os.path.abspath(os.path.join(dirpath, file))
                    first_classname = Module.get_first_classname(abs_path)
                    if first_classname is not None:
                        new_module = Module(self.workspace, title=file,
                                            main_class=first_classname)
                        self.add_module(new_module, alert_collision=False)
                    else:
                        print("Can't found class in file " + file)
            break
        self.load_edges()
        self.load_existing_placement()

        self.redraw()