|
|
|
@ -53,6 +53,11 @@ def mapped(cls):
|
|
|
|
|
_model2schema[cls.Meta.model] = cls
|
|
|
|
|
return cls
|
|
|
|
|
|
|
|
|
|
class Logger:
|
|
|
|
|
""" helps with counting and colorizing
|
|
|
|
|
imported and exported data
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
class MyYamlLexer(YamlLexer):
|
|
|
|
|
""" colorize yaml constants and integers """
|
|
|
|
|
def get_tokens(self, text, unfiltered=False):
|
|
|
|
@ -76,11 +81,6 @@ class MyYamlLexer(YamlLexer):
|
|
|
|
|
typ = Token.Literal.Number.Integer
|
|
|
|
|
yield typ, value
|
|
|
|
|
|
|
|
|
|
class Logger:
|
|
|
|
|
""" helps with counting and colorizing
|
|
|
|
|
imported and exported data
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
def __init__(self, want_color=None, can_color=False, debug=False, secrets=False):
|
|
|
|
|
|
|
|
|
|
self.lexer = 'yaml'
|
|
|
|
@ -323,7 +323,7 @@ class Logger:
|
|
|
|
|
return data
|
|
|
|
|
|
|
|
|
|
lexer = lexer or self.lexer
|
|
|
|
|
lexer = MyYamlLexer() if lexer == 'yaml' else get_lexer_by_name(lexer)
|
|
|
|
|
lexer = Logger.MyYamlLexer() if lexer == 'yaml' else get_lexer_by_name(lexer)
|
|
|
|
|
formatter = get_formatter_by_name(formatter or self.formatter, colorscheme=self.colorscheme)
|
|
|
|
|
if strip is None:
|
|
|
|
|
strip = self.strip
|
|
|
|
|