Esempio n. 1
0
 def lastLeapForward(self):
     try:
         archyState.commandHistory.repeatLastLeapForward()
     except commands.AbortCommandException, e:
         messages.hide()
         messages.queue("%s: %s" % ("LEAP Forward again", e.getExplanation()))
         messages.display()
Esempio n. 2
0
 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)
Esempio n. 3
0
 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()
Esempio n. 4
0
 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()
Esempio n. 5
0
 def start(self):
     print "about to set quasimode to main text entry"
     self.setQuasimode(MainTextEntry(self))
     messages.hide()
Esempio n. 6
0
 def onAbort(self):
     self.parent.hideWhitespace()
     self.parent.hidePreselection()
     messages.unqueue('command')
     messages.hide()
Esempio n. 7
0
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)
Esempio n. 8
0
def scrollDown():
    messages.hide()
    archyState.mainTextViewer.scrollDown()
Esempio n. 9
0
def creepRight():
    messages.hide()
    command_object = archyState.commandMap.findSystemCommand( 'CreepRight' )
    archyState.commandHistory.executeCommand(command_object)
Esempio n. 10
0
                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" )
Esempio n. 11
0
def deletemessage(id):
    if messages.hide(id):
        return redirect("/")
    else:
        return render_template("error.html",
                               message="Message deletion failed.")