Browse Source

Moved all imports to the top of the file

atexit
Raphael Roberts 6 years ago
parent
commit
d6f0f58a0a
  1. 8
      ctabus/__init__.py

8
ctabus/__init__.py

@ -20,6 +20,8 @@ from ctabus import fetch
from ctabus.internal.config import log_dir, recent_list
from ctabus.internal.disk_cache import disk_cache, make_key
from ctabus.internal.notification import NotificationManager, HAS_NOTIFICATION
from ctabus.internal.print2d import create_table, render_table
from ctabus.internal.search import Search, StopSearch
HAS_TOAST = shutil.which("termux-toast") is not None
CHICAGO_TZ = tz.gettz("America/Chicago")
@ -103,8 +105,6 @@ def pprint_delta(delta):
class Table:
imported = False
def __init__(self, dicts):
self.dicts = dicts
self.display = None
@ -128,7 +128,6 @@ class Table:
]
def get_index_interactive(self):
from ctabus.internal.print2d import create_table, render_table
if self.display is None:
raise Exception("Display columns not set")
@ -147,7 +146,6 @@ class Table:
return which
def get_name_interactive(self, data_column):
from ctabus.internal.print2d import create_table, render_table
if self.display is None:
raise Exception("Display columns not set")
@ -242,8 +240,6 @@ def show(
def _picker(args):
# save on import time slightly
from ctabus.internal.search import Search, StopSearch
# routes
if not args.route:

Loading…
Cancel
Save