[config] Allow parameter passing via commandline

Allow the user to specify arbitrary configuration parameters from the
commandline and evaluate those in the modules (and elsewhere). Re-enable
the CPU module as a first showcase of this functionality.
This commit is contained in:
Tobias Witek 2016-11-05 12:28:05 +01:00
parent 353c47d76e
commit 18d7e1befb
4 changed files with 29 additions and 12 deletions

View file

@ -19,7 +19,7 @@ class Theme:
self.begin()
def begin(self):
self._config.parameter("theme.cycleidx", 0)
self._config.set("theme.cycleidx", 0)
self._cycle = self._cycles[0] if len(self._cycles) > 0 else {}
self._background = [ None, None ]
@ -64,7 +64,7 @@ class Theme:
return self._background[1]
def separator_block_width(self, widget):
return 9
return self._get(widget, "separator-block-width")
def _get(self, widget, name):
module = widget.module()