diff options
author | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2024-02-23 13:02:03 -0800 |
---|---|---|
committer | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2024-02-23 13:02:03 -0800 |
commit | 8662a3dc0820c9e2811658e4b490ef67a4eee3dc (patch) | |
tree | 649bdd2457ddd670bca42a2df317909ec4a78f9c /panel.py | |
parent | 43c215b4de76bb2a5558c9db4011572274287d36 (diff) | |
download | panel-8662a3dc0820c9e2811658e4b490ef67a4eee3dc.tar.gz panel-8662a3dc0820c9e2811658e4b490ef67a4eee3dc.tar.xz |
add static text module
Diffstat (limited to 'panel.py')
-rwxr-xr-x | panel.py | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -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) |