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