mirror of
https://github.com/nvbn/thefuck.git
synced 2025-02-21 20:38:54 +00:00
#414: Initialize output before any colorama import
This commit is contained in:
parent
29c1d1efcf
commit
b65a9a0a4f
@ -1,3 +1,8 @@
|
|||||||
|
# Initialize output before importing any module, that can use colorama.
|
||||||
|
from .system import init_output
|
||||||
|
|
||||||
|
init_output()
|
||||||
|
|
||||||
from argparse import ArgumentParser
|
from argparse import ArgumentParser
|
||||||
from warnings import warn
|
from warnings import warn
|
||||||
from pprint import pformat
|
from pprint import pformat
|
||||||
@ -8,12 +13,10 @@ from .corrector import get_corrected_commands
|
|||||||
from .exceptions import EmptyCommand
|
from .exceptions import EmptyCommand
|
||||||
from .utils import get_installation_info
|
from .utils import get_installation_info
|
||||||
from .ui import select_command
|
from .ui import select_command
|
||||||
from .system import init_output
|
|
||||||
|
|
||||||
|
|
||||||
def fix_command():
|
def fix_command():
|
||||||
"""Fixes previous command. Used when `thefuck` called without arguments."""
|
"""Fixes previous command. Used when `thefuck` called without arguments."""
|
||||||
init_output()
|
|
||||||
settings.init()
|
settings.init()
|
||||||
with logs.debug_time('Total'):
|
with logs.debug_time('Total'):
|
||||||
logs.debug(u'Run with settings: {}'.format(pformat(settings)))
|
logs.debug(u'Run with settings: {}'.format(pformat(settings)))
|
||||||
@ -51,7 +54,6 @@ def how_to_configure_alias():
|
|||||||
It'll be only visible when user type fuck and when alias isn't configured.
|
It'll be only visible when user type fuck and when alias isn't configured.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
init_output()
|
|
||||||
settings.init()
|
settings.init()
|
||||||
logs.how_to_configure_alias(shells.how_to_configure())
|
logs.how_to_configure_alias(shells.how_to_configure())
|
||||||
|
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
import sys
|
import sys
|
||||||
import msvcrt
|
import msvcrt
|
||||||
import colorama
|
|
||||||
import win_unicode_console
|
import win_unicode_console
|
||||||
from .. import const
|
from .. import const
|
||||||
|
|
||||||
|
|
||||||
def init_output():
|
def init_output():
|
||||||
|
import colorama
|
||||||
win_unicode_console.enable()
|
win_unicode_console.enable()
|
||||||
colorama.init()
|
colorama.init()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user