Merge branch 'master' into celestia-wayland
This commit is contained in:
commit
fd369552d0
2 changed files with 8 additions and 4 deletions
|
@ -28,20 +28,22 @@
|
|||
from libqtile import hook
|
||||
from libqtile.log_utils import logger
|
||||
from kuro.utils import load_config_class
|
||||
import traceback
|
||||
|
||||
try:
|
||||
from kuro.theme import Kuro
|
||||
Theme = Kuro()
|
||||
except ImportError as e:
|
||||
logger.error(traceback.format_exc())
|
||||
logger.error("Could not load Kuro Theme. Trying to load BaseTheme. Error: {}".format(e))
|
||||
try:
|
||||
from kuro.base import BaseTheme as Kuro
|
||||
Theme = Kuro()
|
||||
except ImportError as e:
|
||||
Kuro = None
|
||||
logger.error(traceback.format_exc())
|
||||
raise ImportError("Could not load theme Config or BaseTheme! Error: {}".format(e))
|
||||
|
||||
|
||||
# Import theme configuration
|
||||
Config = load_config_class()
|
||||
if Config is None:
|
||||
|
@ -106,6 +108,7 @@ try:
|
|||
except Exception as e:
|
||||
Theme = None
|
||||
Config = None
|
||||
logger.error(traceback.format_exc())
|
||||
raise AttributeError("Could not configure theme! Error: {}".format(e))
|
||||
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import socket
|
||||
import importlib
|
||||
import socket
|
||||
import traceback
|
||||
from libqtile.log_utils import logger
|
||||
|
||||
def load_config_class():
|
||||
|
@ -18,7 +19,7 @@ def load_config_class():
|
|||
conf_module = importlib.import_module("kuro.config")
|
||||
return getattr(conf_module, "Config")
|
||||
except ImportError as e:
|
||||
pass
|
||||
logger.error(traceback.format_exc())
|
||||
logger.error("Could not load Kuro Config. Trying to load BaseConfig. Error: {}".format(e))
|
||||
|
||||
# If no config yet, load fallback BaseConfig
|
||||
|
@ -26,5 +27,5 @@ def load_config_class():
|
|||
base_module = importlib.import_module("kuro.base")
|
||||
return getattr(base_module, "BaseConfig")
|
||||
except ImportError as e:
|
||||
pass
|
||||
logger.error(traceback.format_exc())
|
||||
return None
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue