Пример #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