[all] Major refactoring

Introduce an "Engine" class to abstract some of the details of loading
modules, registering events, etc.
This commit is contained in:
Tobias Witek 2016-11-04 21:03:12 +01:00
parent a6bdd0557c
commit d62258c89d
5 changed files with 135 additions and 116 deletions

View file

@ -7,10 +7,10 @@ def getpath():
class Theme:
_cycle_index = 0
_cycle = None
def __init__(self, name="default"):
def __init__(self, args):
self._data = None
path = os.path.dirname(os.path.realpath(__file__))
with open("{}/{}.json".format(getpath(), name)) as f:
with open("{}/{}.json".format(getpath(), args.theme)) as f:
self._data = json.load(f)
self._defaults = self._data.get("defaults", {})
self._cycle = self._defaults.get("cycle", [])