[core/widget] Add widget class

To maintain backwards compatibility (and because I think it's an OK
design choice), keep the widget concept (a single module can produce
multiple widgets).
This commit is contained in:
Tobias Witek 2020-01-26 13:58:29 +01:00
parent a17cd4759c
commit fee7cf7882
2 changed files with 53 additions and 0 deletions

15
core/widget.py Normal file
View file

@ -0,0 +1,15 @@
import util.store
class Widget(util.store.Store):
def __init__(self, full_text):
self._full_text = full_text
def full_text(self, value=None):
if value:
self._full_text = value
else:
if callable(self._full_text):
return self._full_text(self)
return self._full_text
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4