Esempio 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
Esempio n. 2
0
File: main.py Progetto: 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
Esempio 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
Esempio n. 4
0
def _pprint_displayhook(value):
    if value is not None:
        builtins._ = value
        pprint(value)
Esempio n. 5
0
def _pprint_displayhook(value):
    if value is not None:
        builtins._ = value
        pprint(value)
Esempio n. 6
0
def _pprint_displayhook(value):
    if value is not None:
        builtins._ = None  # Set '_' to None to avoid recursion
        pprint(value)
        builtins._ = value
Esempio n. 7
0
def _pprint_displayhook(value):
    if value is not None:
        __builtins__['_'] = value
        pprint(value)
Esempio n. 8
0
def _pprint_displayhook(value):
    if value is not None:
        __builtins__["_"] = value
        pprint(value)