[all] Major refactoring
Introduce an "Engine" class to abstract some of the details of loading modules, registering events, etc.
This commit is contained in:
parent
a6bdd0557c
commit
d62258c89d
5 changed files with 135 additions and 116 deletions
|
@ -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", [])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue