Browse Source

Remove unused imports and refactor logging

croc
Luke Murphy 4 years ago
parent
commit
e30aae2794
No known key found for this signature in database GPG Key ID: 5E2EF5A63E3718CC
  1. 7
      dropship/__init__.py
  2. 5
      dropship/dropship.py
  3. 5
      dropship/logging.py
  4. 2
      dropship/ui_templates.py
  5. 2
      dropship/wormhole.py

7
dropship/__init__.py

@ -1,6 +1,3 @@
from logging import basicConfig, getLogger
from os import environ
from trio import open_nursery, sleep_forever
from trio_gtk import run
@ -15,7 +12,3 @@ def main():
await sleep_forever()
run(_main)
basicConfig(level=environ.get("LOGLEVEL", "INFO"))
log = getLogger("dropship")

5
dropship/dropship.py

@ -1,10 +1,7 @@
from os.path import basename
from pathlib import Path
from gi import require_version
from trio import CancelScope, open_process, run_process
from dropship import log
from dropship.logging import log
require_version("Gtk", "3.0")
require_version("Gdk", "3.0")

5
dropship/logging.py

@ -0,0 +1,5 @@
from logging import basicConfig, getLogger
from os import environ
basicConfig(level=environ.get("LOGLEVEL", "INFO"))
log = getLogger("dropship")

2
dropship/ui_templates.py

@ -1,5 +1,3 @@
from pathlib import Path
import gi
gi.require_version("Gtk", "3.0")

2
dropship/wormhole.py

@ -2,7 +2,7 @@ from subprocess import PIPE
from trio import TASK_STATUS_IGNORED, CancelScope, open_process, run_process
from dropship import log
from dropship.logging import log
async def wormhole_send(fpath, parent, task_status=TASK_STATUS_IGNORED):

Loading…
Cancel
Save