ui: Simplify the ui support detection logic.

This commit is contained in:
Damir Jelić 2019-07-17 22:53:29 +02:00
parent bb9cda8902
commit 872267073b

View File

@ -14,7 +14,10 @@
from importlib import util
if util.find_spec("pybdubs") and util.find_spec("gi.repository"):
UI_ENABLED = (util.find_spec("gi.repository") is not None
and util.find_spec("pydbus") is not None)
if UI_ENABLED:
from collections import defaultdict
from queue import Empty
@ -579,6 +582,3 @@ if util.find_spec("pybdubs") and util.find_spec("gi.repository"):
if self.loop:
self.loop.quit()
self.loop = None
else:
UI_ENABLED = False