summaryrefslogtreecommitdiff
path: root/ttystatus/status.py
diff options
context:
space:
mode:
Diffstat (limited to 'ttystatus/status.py')
-rw-r--r--ttystatus/status.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/ttystatus/status.py b/ttystatus/status.py
index b5d743a..722d69f 100644
--- a/ttystatus/status.py
+++ b/ttystatus/status.py
@@ -44,6 +44,11 @@ class TerminalStatus(object):
else:
for key in widget.interesting_keys:
self._interests[key] = self._interests.get(key, []) + [widget]
+
+ def format(self, format_string):
+ '''Add new widgets based on format string.'''
+ for widget in ttystatus.fmt.parse(format_string):
+ self.add(widget)
def clear(self):
'''Remove all widgets.'''