Browse Source

Converted most imports to lazy imports

atexit
Raphael Roberts 6 years ago
parent
commit
5a73cae413
  1. 25
      ctabus/__init__.py

25
ctabus/__init__.py

@ -16,12 +16,27 @@ import sys
import time
import urllib
from ctabus import fetch
import lazy_import
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
from ctabus.internal.notification import HAS_NOTIFICATION
fetch = lazy_import.lazy_module("ctabus.fetch")
disk_cache = lazy_import.lazy_class("ctabus.internal.disk_cache.disk_cache")
make_key = lazy_import.lazy_function("ctabus.internal.disk_cache.make_key")
NotificationManager = lazy_import.lazy_class(
"ctabus.internal.notification.NotificationManager"
)
create_table = lazy_import.lazy_function("ctabus.internal.print2d.create_table")
render_table = lazy_import.lazy_function("ctabus.internal.print2d.render_table")
Search = lazy_import.lazy_class("ctabus.internal.search.Search")
StopSearch = lazy_import.lazy_class("ctabus.internal.search.StopSearch")
HAS_TOAST = shutil.which("termux-toast") is not None
CHICAGO_TZ = tz.gettz("America/Chicago")

Loading…
Cancel
Save