[config] Start refactoring by creating separate config class

Add a class that will hold all configuration and argument information
and serve as central repository for this kind of information.
This commit is contained in:
Tobias Witek 2016-11-05 07:54:36 +01:00
parent df27355977
commit a58610f3ee
4 changed files with 100 additions and 2 deletions

View file

@ -1,9 +1,14 @@
import os
import json
import glob
def getpath():
return os.path.dirname("{}/themes/".format(os.path.dirname(os.path.realpath(__file__))))
def themes():
d = getpath()
return [ os.path.basename(f).replace(".json", "") for f in glob.iglob("{}/*.json".format(d)) ]
class Theme:
_cycle_index = 0
_cycle = None