diff --git a/core/decorators.py b/core/decorators.py index 2d39521..91727f9 100644 --- a/core/decorators.py +++ b/core/decorators.py @@ -11,7 +11,7 @@ def scrollable(func): if width < 0 or len(text) <= width: return text - bounce = util.format.asint(module.parameter('scrolling.bounce', 1)) + bounce = util.format.asbool(module.parameter('scrolling.bounce', True)) scroll_speed = util.format.asint(module.parameter('scrolling.speed', 1)) start = widget.get('scrolling.start', -1) direction = widget.get('scrolling.direction', 'right') diff --git a/core/module.py b/core/module.py index e45d3f1..8f159d6 100644 --- a/core/module.py +++ b/core/module.py @@ -30,6 +30,9 @@ class Module(core.input.Object): # TODO retrieve from config file return value + def set(self, key, value): + self._config.set('{}.{}'.format(self.name(), key), value) + def update(self): pass @@ -48,7 +51,9 @@ class Error(Module): self._module = module self._error = error - self.widgets()[0].set('theme.width', 15) + self.set('scrolling.bounce', False) + self.set('scrolling.speed', 2) + self.set('width', 15) @core.decorators.scrollable def full_text(self, widget):