bd7ff3c8f1
Expanding on the implementation in d582016
, add a decorator
`core.module.every()` that allows a module to specify how often to
update the module's state.
This can still be overridden using the CLI parameter `interval`.
18 lines
432 B
Python
18 lines
432 B
Python
# pylint: disable=C0111,R0903
|
|
|
|
"""Shows Linux kernel version information"""
|
|
|
|
import platform
|
|
|
|
import core.module
|
|
import core.widget
|
|
|
|
class Module(core.module.Module):
|
|
@core.module.every(minutes=60)
|
|
def __init__(self, config=None):
|
|
super().__init__(config, core.widget.Widget(self.full_text))
|
|
|
|
def full_text(self, widgets):
|
|
return platform.release()
|
|
|
|
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
|