Ejemplo n.º 1
0
    def run(self, args):
        if len(args) > 0:
            if len(args) == 1 and "*" == args[0]:
                macro_names = list(self.proc.macros.keys())
            else:
                macro_names = args
                pass

            for macro_name in sorted(macro_names):
                if macro_name in self.proc.macros:
                    self.section("%s:" % macro_name)
                    string = self.proc.macros[macro_name][1]
                    highlight = self.settings["highlight"]
                    if highlight in ["light", "dark"]:
                        string = highlight_string(string, highlight)
                        pass
                    self.msg("  %s" % string)
                else:
                    self.errmsg("%s is not a defined macro" % macro_name)
                    pass
                pass
        elif 0 == len(list(self.proc.macros.keys())):
            self.msg("No macros defined.")
        else:
            self.msg(self.columnize_commands(list(self.proc.macros.keys())))
            pass
        return
Ejemplo n.º 2
0
  def run(self, args):
    if len(args) > 0:
      if len(args) == 1 and '*' == args[0]:
        macro_names = list(self.proc.macros.keys())
      else:
        macro_names = args
        pass
      pass

      for macro_name in sorted(macro_names):
        if macro_name in self.proc.macros:
          self.section("%s:" % macro_name)
          string = self.proc.macros[macro_name][1]
          highlight = self.settings['highlight']
          if  highlight in ['light', 'dark']:
            string = highlight_string(string, highlight)
            pass
          self.msg("  %s" % string)
        else:
          self.errmsg('%s is not a defined macro' % macro_name)
          pass
        pass
    elif 0 == len(list(self.proc.macros.keys())):
      self.msg('No macros defined.')
    else:
      self.msg(self.columnize_commands(list(self.proc.macros.keys())))
      pass
    return
Ejemplo n.º 3
0
 def print_text(self, text):
     if self.settings['highlight'] == 'plain':
         self.msg(text)
         return
     opts = {'bg': self.settings['highlight']}
     if 'style' in self.settings:
         opts['style'] = self.settings['style']
     self.msg(highlight_string(text, opts).strip("\n"))
Ejemplo n.º 4
0
    def print_text(self, text):
        if self.settings['highlight'] == 'plain':
            self.msg(text)
            return
        opts = {'bg': self.settings['highlight']}

        if 'style' in self.settings:
            opts['style'] = self.settings['style']
        self.msg(highlight_string(text, opts).strip("\n"))
Ejemplo n.º 5
0
    def print_text(self, text):
        if self.settings["highlight"] == "plain":
            self.msg(text)
            return
        opts = {"bg": self.settings["highlight"]}

        if "style" in self.settings:
            opts["style"] = self.settings["style"]
        self.msg(highlight_string(text, opts).strip("\n"))