Remove unused imports and refactor logging
This commit is contained in:
parent
f03b038ee3
commit
e30aae2794
@ -1,6 +1,3 @@
|
|||||||
from logging import basicConfig, getLogger
|
|
||||||
from os import environ
|
|
||||||
|
|
||||||
from trio import open_nursery, sleep_forever
|
from trio import open_nursery, sleep_forever
|
||||||
from trio_gtk import run
|
from trio_gtk import run
|
||||||
|
|
||||||
@ -15,7 +12,3 @@ def main():
|
|||||||
await sleep_forever()
|
await sleep_forever()
|
||||||
|
|
||||||
run(_main)
|
run(_main)
|
||||||
|
|
||||||
|
|
||||||
basicConfig(level=environ.get("LOGLEVEL", "INFO"))
|
|
||||||
log = getLogger("dropship")
|
|
||||||
|
@ -1,10 +1,7 @@
|
|||||||
from os.path import basename
|
|
||||||
from pathlib import Path
|
|
||||||
|
|
||||||
from gi import require_version
|
from gi import require_version
|
||||||
from trio import CancelScope, open_process, run_process
|
from trio import CancelScope, open_process, run_process
|
||||||
|
|
||||||
from dropship import log
|
from dropship.logging import log
|
||||||
|
|
||||||
require_version("Gtk", "3.0")
|
require_version("Gtk", "3.0")
|
||||||
require_version("Gdk", "3.0")
|
require_version("Gdk", "3.0")
|
||||||
|
5
dropship/logging.py
Normal file
5
dropship/logging.py
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
from logging import basicConfig, getLogger
|
||||||
|
from os import environ
|
||||||
|
|
||||||
|
basicConfig(level=environ.get("LOGLEVEL", "INFO"))
|
||||||
|
log = getLogger("dropship")
|
@ -1,5 +1,3 @@
|
|||||||
from pathlib import Path
|
|
||||||
|
|
||||||
import gi
|
import gi
|
||||||
|
|
||||||
gi.require_version("Gtk", "3.0")
|
gi.require_version("Gtk", "3.0")
|
||||||
|
@ -2,7 +2,7 @@ from subprocess import PIPE
|
|||||||
|
|
||||||
from trio import TASK_STATUS_IGNORED, CancelScope, open_process, run_process
|
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):
|
async def wormhole_send(fpath, parent, task_status=TASK_STATUS_IGNORED):
|
||||||
|
Loading…
Reference in New Issue
Block a user