def load(self, text): try: self.prog = StatementProg(TokenSequence(text)) except LanguageException, w: self.prog = None self.window_generator( 'Load-time error!', ((CloseButton, DoubleScrolledText(str(w), 40, 10))))
def reread(self): if not self.filename is None: try: f = file(self.filename, 'r') self.filetext = f.read() f.close() except Exception, w: self.filetext = '' self.filename = None self.app.window_generator('Error!', (CloseButton, DoubleScrolledText(str(w), 40, 10)))
def go(self): for i in xrange(500): if self.context.prog is None: self.status_line('Done.') break self.context.status_line = None try: self.context.prog(self.context) except LanguageException, w: self.prog = None self.window_generator( 'Run-time error!', ((CloseButton, DoubleScrolledText(str(w), 40, 10)))) self.status_line('Run-time error!') break except KeyboardInterrupt, w: self.root.quit()
def tort_stat(self): self.app.window_generator( 'Tortoise status', (CloseButton, DoubleScrolledText(self.app.tortoise_driver.tortoise_status(), 40, 12)))
def box_size(self): self.app.window_generator( 'Geometry', (CloseButton, DoubleScrolledText(self.app.tortoise_driver.showbox(), 40, 14)))
def showvars(self): self.app.window_generator( 'Variables', (CloseButton, DoubleScrolledText(self.app.tortoise_driver.showvars(), 40, 20)))
def help_license(self): self.app.window_generator( 'License', (CloseButton, DoubleScrolledText(license_text, 60, 33)))
def help_about(self): self.app.window_generator( 'About', (CloseButton, DoubleScrolledText(about_text, 33, 10)))