Exemplo n.º 1
0
 def P(self, content, sep=False):
     if isinstance(content, bytes):
         content = content.decode()
     if self._opt("highlight"):
         hl = self._opt("highlight")
         hl = hl if isinstance(hl, list) else [hl]
         for h in hl:
             if content.find(h) > -1:
                 if not re.findall("33\/.*{0}.*33\/".format(h), content):
                     content = content.replace(
                         h, Printer.Highlighter(h, "yellow"))
     print("{0}{1}{0}".format("\n" if sep else "", content))
Exemplo n.º 2
0
    def Intro(self, source, log_cnt, prnt=False):

        x = "\n".join([
            Printer.Highlighter(("<" * 55) + " belch CLI " + (">" * 55),
                                "orange"), "Source: {0}".format(source),
            "Records: {0}".format(log_cnt), ""
        ])

        if not prnt:
            return x
        else:
            self.P(x)
Exemplo n.º 3
0
 def GetPrompt(self):
     return Printer.Highlighter("b3l(h> ", "orange")
Exemplo n.º 4
0
 def Warring(self, mesage):
     self.P(Printer.Highlighter(message, "yellow"))
Exemplo n.º 5
0
 def Error(self, message):
     self.P(Printer.Highlighter(message, "red"))
Exemplo n.º 6
0
 def Success(self, message):
     self.P(Printer.Highlighter(message, "green"))