Exemplo n.º 1
0
def _pprint_displayhook(value):
    if value is not None:
        builtins._ = None  # Set '_' to None to avoid recursion
        if HAVE_PYGMENTS:
            s = pretty(value)  # color case
            lexer = pyghooks.XonshLexer()
            tokens = list(pygments.lex(s, lexer=lexer))
            print_color(tokens)
        else:
            pprint(value)  # black & white case
        builtins._ = value
Exemplo n.º 2
0
Arquivo: main.py Projeto: refi64/xonsh
def _pprint_displayhook(value):
    if value is None or isinstance(value, HiddenCompletedCommand):
        return
    builtins._ = None  # Set '_' to None to avoid recursion
    if HAVE_PYGMENTS:
        s = pretty(value)  # color case
        lexer = pyghooks.XonshLexer()
        tokens = list(pygments.lex(s, lexer=lexer))
        print_color(tokens)
    else:
        pprint(value)  # black & white case
    builtins._ = value
Exemplo n.º 3
0
def _pprint_displayhook(value):
    if value is None or isinstance(value, HiddenCompletedCommand):
        return
    builtins._ = None  # Set '_' to None to avoid recursion
    if HAS_PYGMENTS:
        s = pretty(value)  # color case
        lexer = pyghooks.XonshLexer()
        tokens = list(pygments.lex(s, lexer=lexer))
        print_color(tokens)
    else:
        pprint(value)  # black & white case
    builtins._ = value
Exemplo n.º 4
0
def _pprint_displayhook(value):
    if value is not None:
        builtins._ = value
        pprint(value)
Exemplo n.º 5
0
def _pprint_displayhook(value):
    if value is not None:
        builtins._ = value
        pprint(value)
Exemplo n.º 6
0
def _pprint_displayhook(value):
    if value is not None:
        builtins._ = None  # Set '_' to None to avoid recursion
        pprint(value)
        builtins._ = value
Exemplo n.º 7
0
def _pprint_displayhook(value):
    if value is not None:
        __builtins__['_'] = value
        pprint(value)
Exemplo n.º 8
0
def _pprint_displayhook(value):
    if value is not None:
        __builtins__["_"] = value
        pprint(value)