aboutsummaryrefslogtreecommitdiff
path: root/Utils.py
diff options
context:
space:
mode:
authorGravatar jesopo2018-09-21 11:38:55 +0100
committerGravatar jesopo2018-09-21 11:39:09 +0100
commita87196c608a237968918d1c21985926850001598 (patch)
tree9327e021f1c1fa6258f5e9a57273bb72706b0ed3 /Utils.py
parentDon't pass around full server details more than we have to. (diff)
Change Utils.color to take a string to wrap in color
Diffstat (limited to 'Utils.py')
-rw-r--r--Utils.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Utils.py b/Utils.py
index e2da0c43..40445606 100644
--- a/Utils.py
+++ b/Utils.py
@@ -156,12 +156,12 @@ FONT_BOLD, FONT_ITALIC, FONT_UNDERLINE, FONT_INVERT = ("\x02", "\x1D",
"\x1F", "\x16")
FONT_COLOR, FONT_RESET = "\x03", "\x0F"
-def color(foreground, background=None):
+def color(s, foreground, background=None):
foreground = str(foreground).zfill(2)
if background:
background = str(background).zfill(2)
- return "%s%s%s" % (FONT_COLOR, foreground,
- "" if not background else ",%s" % background)
+ return "%s%s%s%s%s" % (FONT_COLOR, foreground,
+ "" if not background else ",%s" % background, s, FONT_COLOR)
def bold(s):
return "%s%s%s" % (FONT_BOLD, s, FONT_BOLD)