1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-06-21 00:19:42 +02:00

move imports to the top

This commit is contained in:
Kelly Brazil
2021-05-10 21:02:28 -07:00
parent e4574047a0
commit c3b814a15f

View File

@ -14,6 +14,9 @@ import subprocess
import json import json
import jc import jc
import jc.appdirs as appdirs import jc.appdirs as appdirs
import jc.utils
import jc.tracebackplus
# make pygments import optional # make pygments import optional
try: try:
import pygments import pygments
@ -475,8 +478,6 @@ def run_user_command(command):
def main(): def main():
import jc.utils
# break on ctrl-c keyboard interrupt # break on ctrl-c keyboard interrupt
signal.signal(signal.SIGINT, ctrlc) signal.signal(signal.SIGINT, ctrlc)
@ -539,7 +540,6 @@ def main():
sys.exit(0) sys.exit(0)
if verbose_debug: if verbose_debug:
import jc.tracebackplus
jc.tracebackplus.enable(context=11) jc.tracebackplus.enable(context=11)
if sys.stdin.isatty() and magic_stdout is None: if sys.stdin.isatty() and magic_stdout is None:
@ -575,7 +575,6 @@ def main():
if debug: if debug:
raise raise
else: else:
import jc.utils
jc.utils.error_message( jc.utils.error_message(
f'{parser_name} parser could not parse the input data. Did you use the correct parser?\n' f'{parser_name} parser could not parse the input data. Did you use the correct parser?\n'
' For details use the -d or -dd option. Use "jc -h" for help.') ' For details use the -d or -dd option. Use "jc -h" for help.')