示例#1
0
文件: ui.py 项目: geier/alot
 def apply_this_command(ignored, cmdstring):
     logging.debug('%s command string: "%s"' % (self.mode,
                                                str(cmdstring)))
     # translate cmdstring into :class:`Command`
     cmd = commandfactory(cmdstring, self.mode)
     # store cmdline for use with 'repeat' command
     if cmd.repeatable:
         self.last_commandline = cmdline
     return self.apply_command(cmd)
示例#2
0
 def apply_this_command(ignored, cmdstring):
     logging.debug('%s command string: "%s"' %
                   (self.mode, str(cmdstring)))
     # translate cmdstring into :class:`Command`
     cmd = commandfactory(cmdstring, self.mode)
     # store cmdline for use with 'repeat' command
     if cmd.repeatable:
         self.last_commandline = cmdline
     return self.apply_command(cmd)
示例#3
0
文件: ui.py 项目: t-8ch/alot
 def keypress(self, size, key):
     """overwrites `urwid.WidgetWrap.keypress`"""
     mode = self.ui.mode
     if self.select_cancel_only:
         mode = 'global'
     cmdline = settings.get_keybinding(mode, key)
     if cmdline:
         try:
             cmd = commandfactory(cmdline, mode)
             if self.allowed_command(cmd):
                 self.ui.apply_command(cmd)
                 return None
         except CommandParseError, e:
             self.ui.notify(e.message, priority='error')
示例#4
0
文件: ui.py 项目: tlevine/alot
 def apply_this_command(ignored, cmdstring):
     logging.debug('%s command string: "%s"' %
                   (self.mode, str(cmdstring)))
     #logging.debug('CMDSEQ: apply %s' % str(cmdstring))
     # translate cmdstring into :class:`Command`
     #try:
     cmd = commandfactory(cmdstring, self.mode)
     #except CommandParseError, e:
     #   self.notify(e.message, priority='error')
     #  return
     # store cmdline for use with 'repeat' command
     if cmd.repeatable:
         self.last_commandline = cmdline
     return self.apply_command(cmd)
示例#5
0
文件: ui.py 项目: jdashb/alot
 def apply_this_command(ignored, cmdstring):
     logging.debug('%s command string: "%s"' % (self.mode,
                                                str(cmdstring)))
     #logging.debug('CMDSEQ: apply %s' % str(cmdstring))
     # translate cmdstring into :class:`Command`
     #try:
     cmd = commandfactory(cmdstring, self.mode)
     #except CommandParseError, e:
      #   self.notify(e.message, priority='error')
       #  return
     # store cmdline for use with 'repeat' command
     if cmd.repeatable:
         self.last_commandline = cmdline
     return self.apply_command(cmd)
示例#6
0
文件: ui.py 项目: fagga/alot
    def apply_commandline(self, cmdline):
        """
        Interprets a command line string and applies the resulting
        (sequence of) :class:`Commands <alot.commands.Command>`.

        :param cmdline: command line to interpret
        :type cmdline: str
        """
        # split commandline if necessary
        cmd = None
        cmdlist = split_commandline(cmdline)
        if len(cmdlist) == 1:
            try:
                # translate cmdstring into :class:`Command`
                cmd = commandfactory(cmdlist[0], self.mode)
            except CommandParseError, e:
                self.notify(e.message, priority='error')
                return