diff --git a/bumblebee/engine.py b/bumblebee/engine.py index 1ded7c5..9315da5 100644 --- a/bumblebee/engine.py +++ b/bumblebee/engine.py @@ -41,6 +41,7 @@ class Module(object): self.error = None self._next = int(time.time()) self._default_interval = 0 + self._interval_factor = 1 self._engine = engine self._configFile = None @@ -99,7 +100,10 @@ class Module(object): except Exception as e: log.error("error updating '{}': {}".format(self.name, str(e))) self.error = str(e) - self._next += int(self.parameter("interval", self._default_interval))*60 + self._next += int(self.parameter("interval", self._default_interval))*self._interval_factor + + def interval_factor(self, factor): + self._interval_factor = factor def interval(self, intvl): self._default_interval = intvl diff --git a/bumblebee/modules/apt.py b/bumblebee/modules/apt.py index dc5fac8..f20cd52 100644 --- a/bumblebee/modules/apt.py +++ b/bumblebee/modules/apt.py @@ -44,6 +44,7 @@ class Module(bumblebee.engine.Module): def __init__(self, engine, config): widget = bumblebee.output.Widget(full_text=self.updates) super(Module, self).__init__(engine, config, widget) + self.interval_factor(60) self.interval(30) def updates(self, widget): diff --git a/bumblebee/modules/currency.py b/bumblebee/modules/currency.py index 3412ff2..b01a186 100644 --- a/bumblebee/modules/currency.py +++ b/bumblebee/modules/currency.py @@ -37,6 +37,7 @@ class Module(bumblebee.engine.Module): bumblebee.output.Widget(full_text=self.price) ) self._data = [] + self.interval_factor(60) self.interval(1) self._base = self.parameter("source", "GBP") self._symbols = self.parameter("destination", "USD,EUR").split(",") diff --git a/bumblebee/modules/dnf.py b/bumblebee/modules/dnf.py index c708bc6..4680141 100644 --- a/bumblebee/modules/dnf.py +++ b/bumblebee/modules/dnf.py @@ -52,6 +52,7 @@ class Module(bumblebee.engine.Module): def __init__(self, engine, config): widget = bumblebee.output.Widget(full_text=self.updates) super(Module, self).__init__(engine, config, widget) + self.interval_factor(60) self.interval(30) def updates(self, widget): diff --git a/bumblebee/modules/github.py b/bumblebee/modules/github.py index 919d30b..3a3d097 100644 --- a/bumblebee/modules/github.py +++ b/bumblebee/modules/github.py @@ -25,6 +25,7 @@ class Module(bumblebee.engine.Module): bumblebee.output.Widget(full_text=self.github) ) self._count = 0 + self.interval_factor(60) self.interval(5) self._requests = requests.Session() self._requests.headers.update({"Authorization":"token {}".format(self.parameter("token", ""))}) diff --git a/bumblebee/modules/stock.py b/bumblebee/modules/stock.py index 152d624..5333700 100644 --- a/bumblebee/modules/stock.py +++ b/bumblebee/modules/stock.py @@ -29,6 +29,7 @@ class Module(bumblebee.engine.Module): self._symbols = self.parameter('symbols', '') self._change = bumblebee.util.asbool(self.parameter('change', True)) self._value = None + self.interval_factor(60) self.interval(60) def value(self, widget): diff --git a/bumblebee/modules/weather.py b/bumblebee/modules/weather.py index 4b07646..8e115ce 100644 --- a/bumblebee/modules/weather.py +++ b/bumblebee/modules/weather.py @@ -42,6 +42,7 @@ class Module(bumblebee.engine.Module): self._showcity = bumblebee.util.asbool(self.parameter("showcity", True)) self._unit = self.parameter("unit", "metric") self._valid = False + self.interval_factor(60) self.interval(15) engine.input.register_callback(self, button=bumblebee.input.LEFT_MOUSE, cmd=self._next_location)