Attempt to fix windows terminal compatibility (ping @jelloslinger). If this is working on windows, we should consider removing blessings in favor of colorama.
This commit is contained in:
@ -164,8 +164,7 @@ class LoopingExecutionContext(Wrapper):
|
||||
:return: to hell
|
||||
"""
|
||||
|
||||
from blessings import Terminal
|
||||
term = Terminal()
|
||||
from bonobo.util import terminal as term
|
||||
print(term.bold(term.red('\U0001F4A3 {} in {}'.format(type(exc).__name__, self.wrapped))))
|
||||
print(trace)
|
||||
|
||||
|
||||
@ -1,8 +1,6 @@
|
||||
import json
|
||||
import os
|
||||
|
||||
from blessings import Terminal
|
||||
|
||||
from bonobo import Tee, JsonWriter, Graph, get_examples_path
|
||||
from bonobo.ext.opendatasoft import OpenDataSoftAPI
|
||||
|
||||
@ -15,7 +13,6 @@ API_DATASET = 'fablabs-in-the-world'
|
||||
API_NETLOC = 'datanova.laposte.fr'
|
||||
ROWS = 100
|
||||
|
||||
t = Terminal()
|
||||
__path__ = os.path.dirname(__file__)
|
||||
|
||||
|
||||
|
||||
@ -21,8 +21,7 @@ import blessings
|
||||
import psutil
|
||||
|
||||
from bonobo.core.plugins import Plugin
|
||||
|
||||
t = blessings.Terminal()
|
||||
from bonobo.util import terminal as t
|
||||
|
||||
|
||||
@lru_cache(1)
|
||||
|
||||
@ -3,20 +3,21 @@
|
||||
import functools
|
||||
from pprint import pprint as _pprint
|
||||
|
||||
import blessings
|
||||
|
||||
from .helpers import console_run, jupyter_run
|
||||
from .tokens import NOT_MODIFIED
|
||||
|
||||
import colorama as _colorama
|
||||
_colorama.init()
|
||||
import blessings as _blessings
|
||||
terminal = _blessings.Terminal()
|
||||
|
||||
__all__ = [
|
||||
'Limit',
|
||||
'NOT_MODIFIED',
|
||||
'PrettyPrint',
|
||||
'Tee',
|
||||
'console_run',
|
||||
'jupyter_run',
|
||||
'noop',
|
||||
'pprint',
|
||||
'terminal',
|
||||
]
|
||||
|
||||
|
||||
@ -51,10 +52,9 @@ pprint = Tee(_pprint)
|
||||
|
||||
|
||||
def PrettyPrint(title_keys=('title', 'name', 'id'), print_values=True, sort=True):
|
||||
term = blessings.Terminal()
|
||||
|
||||
def _pprint(*args, **kwargs):
|
||||
nonlocal title_keys, term, sort, print_values
|
||||
global terminal
|
||||
nonlocal title_keys, sort, print_values
|
||||
|
||||
row = args[0]
|
||||
for key in title_keys:
|
||||
|
||||
Reference in New Issue
Block a user