parent
6eea8da1af
commit
e2a6d41389
2 changed files with 68 additions and 2 deletions
|
@ -1,5 +1,6 @@
|
|||
import os
|
||||
import json
|
||||
import yaml
|
||||
import glob
|
||||
|
||||
def getpath():
|
||||
|
@ -12,8 +13,13 @@ def themes():
|
|||
class Theme:
|
||||
def __init__(self, config):
|
||||
self._config = config
|
||||
with open("{}/{}.json".format(getpath(), config.theme())) as f:
|
||||
self._data = json.load(f)
|
||||
|
||||
if os.path.isfile("{}/{}.yaml".format(getpath(), config.theme())):
|
||||
with open("{}/{}.yaml".format(getpath(), config.theme())) as f:
|
||||
self._data = yaml.load(f)
|
||||
else:
|
||||
with open("{}/{}.json".format(getpath(), config.theme())) as f:
|
||||
self._data = json.load(f)
|
||||
self._defaults = self._data.get("defaults", {})
|
||||
self._cycles = self._defaults.get("cycle", [])
|
||||
self.begin()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue