Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #20 from jaraco/master

Fixed two errors in HTML color handling code
  • Loading branch information...
commit db892646b7b814a2ad6b5eca29ea51a1eb5a6bf0 2 parents 11610b1 + 1f4a5bd
@excid3 authored
Showing with 5 additions and 2 deletions.
  1. +5 −2 logbot.py
View
7 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 @@ def format_event(self, name, event, params):
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
Please sign in to comment.
Something went wrong with that request. Please try again.