From 8e7120103036aadb89b0d6d041afb246c968e0a1 Mon Sep 17 00:00:00 2001 From: tobi-wan-kenobi Date: Sat, 2 May 2020 09:40:09 +0200 Subject: [PATCH] [core/module] name of a widget now equals the module name to make it easier to trigger events programmatically, the IDs for modules are not auto-generated UUIDs anymore, but rather the module name (which has to be unique, anyhow). --- core/module.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/module.py b/core/module.py index 72a79b2..4b10c3a 100644 --- a/core/module.py +++ b/core/module.py @@ -32,16 +32,18 @@ class Module(core.input.Object): super().__init__() self.__config = config self.__widgets = widgets if isinstance(widgets, list) else [ widgets ] - for widget in self.__widgets: - widget.module = self self.module_name = self.__module__.split('.')[-1] self.name = self.module_name self.alias = self.__config.get('__alias__', None) + self.id = self.alias if self.alias else self.name self.next_update = None self.theme = theme + for widget in self.__widgets: + widget.module = self + def hidden(self): return False