def parse_cfg(self, arr): if len(arr) < 4: path = file_opendialog("inc") arr.append(path) self.filename = arr[3] res = self.read_file(self.filename) if not res: raise Exception("Unable to open module source file '%s'" % self.filename) for k in self.objects: o = self.objects[k] if o.fcs == "output": self.add_output(k) if o.fcs == "input": self.add_input(k) o.set_module(self) o.drawable = True del arr[3] Cell.parse_cfg(self, arr)
self.draw_status("rename") if self.mode == MODE_PAN: self.draw_status("pan") pygame.display.update() def run(self): self.running = True; self.controller.reset() while (self.running): delta = self.draw_clock.tick() self.loop() if delta is not 0: self.fps = 1000 / delta profile = False filename = file_opendialog() if filename is not False: a = Canvas() a.controller.read_file(filename) if profile: res = cProfile.run("a.run()", sort="tottime") else: a.run() a.controller.write_file(filename) else: print "No file"
def click(self): self.open_file(utils.file_opendialog())