Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Oliver <excid3@gmail.com>2012-10-10 06:35:59 -0700
committerChris Oliver <excid3@gmail.com>2012-10-10 06:35:59 -0700
commitdb892646b7b814a2ad6b5eca29ea51a1eb5a6bf0 (patch)
treefe90b4bfa5356c7536e192091d0a77539d4e4beb
parent11610b1e43d49bcf7bf6b4251b793d7c321685aa (diff)
parent1f4a5bd42cefa816d8ec9c1b7c60b6255150da0e (diff)
Merge pull request #20 from jaraco/master
Fixed two errors in HTML color handling code
-rwxr-xr-xlogbot.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/logbot.py b/logbot.py
index 80047c7..3bc5dd1 100755
--- a/logbot.py
+++ b/logbot.py
@@ -198,6 +198,8 @@ def replace_color(code, text):
'36': '00aaaa',
'37': 'F5F1DE',
}
+ if code not in colors:
+ return text
return '<span style="color: #%(color)s">%(text)s</span>' % dict(
color = colors[code],
text = text,
@@ -246,8 +248,9 @@ class Logbot(SingleServerIRCBot):
try: msg = msg.replace("%channel%", event.target())
except: pass
msg = msg.replace("%color%", self.color(nm_to_n(event.source())))
- user_message = cgi.escape(event.arguments()[0])
- try: msg = msg.replace("%message%", html_color(user_message))
+ try:
+ user_message = cgi.escape(event.arguments()[0])
+ msg = msg.replace("%message%", html_color(user_message))
except: pass
return msg