def lastLeapForward(self): try: archyState.commandHistory.repeatLastLeapForward() except commands.AbortCommandException, e: messages.hide() messages.queue("%s: %s" % ("LEAP Forward again", e.getExplanation())) messages.display()
def addToMainText(self, keycode, char, upDown): if upDown == DOWN: messages.hide() if char != "": if self.left_shift == DOWN or self.right_shift == DOWN: char = archy_globals.apply_shift_key_to_character(char) addToText(char)
def _executeCommand(self, command, clearDisplay): try: archyState.commandHistory.executeCommand(command) if clearDisplay: messages.hide() except SystemExit: raise except commands.AbortCommandException, e: messages.hide() messages.queue("%s: %s" % (command.name(), e.getExplanation())) messages.display()
def onExit(self): self.parent.hideWhitespace() self.parent.hidePreselection() messages.unqueue('leap') messages.hide() if self.leapCommand.status() == 1: archyState.commandHistory.addToHistory(self.leapCommand) archyState.commandHistory.setLastCommand(self.leapCommand) else: self.restoreViewSettings() if self.leapCommand.status() == 0: pass else: messages.queue(self.info, 'instant') self.playFailedLeapSound()
def start(self): print "about to set quasimode to main text entry" self.setQuasimode(MainTextEntry(self)) messages.hide()
def onAbort(self): self.parent.hideWhitespace() self.parent.hidePreselection() messages.unqueue('command') messages.hide()
def deleteText(): messages.hide() command_object = commands.text_editing.DeleteTextCommand() # TO DO: alter once thread structure is laid out; call #archyThread.commandHistory.executeCommand( command_object ) archyState.commandHistory.executeCommand(command_object)
def scrollDown(): messages.hide() archyState.mainTextViewer.scrollDown()
def creepRight(): messages.hide() command_object = archyState.commandMap.findSystemCommand( 'CreepRight' ) archyState.commandHistory.executeCommand(command_object)
messages.hide() except SystemExit: raise except commands.AbortCommandException, e: messages.hide() messages.queue("%s: %s" % (command.name(), e.getExplanation())) messages.display() except: import debug error_name = "Command %s did not run properly." % command.name() print error_name tb_info = debug.get_traceback() debug.report_bug(error_name, tb_info) messages.hide() messages.queue(error_name) messages.display() def runCommand(self, command): commands.save_and_load.saveChanges() self._executeCommand(command, clearDisplay=1) archyState.commandHistory.setLastCommand(command) def runLastCommand(self): lastCommand = archyState.commandHistory.getLastCommand() if lastCommand == None: return if lastCommand.name()[:4] == "LEAP": if lastCommand.name()[5:13] == 'backward': command = archyState.commandMap.findSystemCommand( "Repeat LEAP backward" )
def deletemessage(id): if messages.hide(id): return redirect("/") else: return render_template("error.html", message="Message deletion failed.")