コード例 #1
0
ファイル: macro.py プロジェクト: rocky/python3-trepan
    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
コード例 #2
0
ファイル: macro.py プロジェクト: mvaled/python3-trepan
  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
コード例 #3
0
ファイル: deparse.py プロジェクト: melviso/python2-trepan
 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"))
コード例 #4
0
ファイル: deparse.py プロジェクト: Paulyd210/python2-trepan
    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"))
コード例 #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"))