[core] Add theme to modules

This commit is contained in:
tobi-wan-kenobi 2020-04-26 16:40:48 +02:00
parent f2d411276d
commit 28bdf4355b
2 changed files with 3 additions and 3 deletions

View file

@ -54,8 +54,7 @@ def main():
input_thread.start() input_thread.start()
for module in config.modules(): for module in config.modules():
modules.append(core.module.load(module, config)) modules.append(core.module.load(module, config, theme))
modules[-1].theme = theme # TODO: make this nice (ctor)
output.modules(modules) output.modules(modules)
core.event.trigger('start') core.event.trigger('start')
while True: while True:
@ -65,7 +64,6 @@ def main():
core.event.trigger('stop') core.event.trigger('stop')
if __name__ == "__main__": if __name__ == "__main__":
main()
try: try:
main() main()
except Exception as e: except Exception as e:

View file

@ -38,6 +38,8 @@ class Module(core.input.Object):
self.alias = self.__config.get('__alias__', None) self.alias = self.__config.get('__alias__', None)
self.next_update = None self.next_update = None
self.theme = theme
def parameter(self, key, default=None): def parameter(self, key, default=None):
value = default value = default