summaryrefslogtreecommitdiff
path: root/panel.py
diff options
context:
space:
mode:
authorDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2024-02-23 13:02:03 -0800
committerDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2024-02-23 13:02:03 -0800
commit8662a3dc0820c9e2811658e4b490ef67a4eee3dc (patch)
tree649bdd2457ddd670bca42a2df317909ec4a78f9c /panel.py
parent43c215b4de76bb2a5558c9db4011572274287d36 (diff)
downloadpanel-8662a3dc0820c9e2811658e4b490ef67a4eee3dc.tar.gz
panel-8662a3dc0820c9e2811658e4b490ef67a4eee3dc.tar.xz
add static text module
Diffstat (limited to 'panel.py')
-rwxr-xr-xpanel.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/panel.py b/panel.py
index b522dc5..0248838 100755
--- a/panel.py
+++ b/panel.py
@@ -84,6 +84,18 @@ class Mod:
def process_cmd(self, cmd):
pass
+class ModText(Mod):
+ def __init__(self, text, fg=None, bg=None, padding=0, **kwargs):
+ super().__init__(**kwargs)
+ buf = text
+ if padding:
+ buf = Fmt.pad(buf, padding)
+ if fg:
+ buf = Fmt.fg(fg, buf)
+ if bg:
+ buf = Fmt.bg(bg, buf)
+ self.out = buf
+
class ModRight(Mod):
def __init__(self, **kwargs):
kwargs.setdefault('spacing', 0)