Browse Source

check if the regexps exist before trying to use them (lots of "None"s being highlighted because of no checking)"

master
Julio Biason 15 years ago
parent
commit
777b11588e
  1. 3
      mitterlib/ui/helpers/gtk_messagegrid.py

3
mitterlib/ui/helpers/gtk_messagegrid.py

@ -187,6 +187,7 @@ class MessageGrid(gtk.ScrolledWindow, gobject.GObject):
message_values['message']) message_values['message'])
# highlight users # highlight users
if data.user_regexp:
user_mask = '(%s)' % (data.user_regexp) user_mask = '(%s)' % (data.user_regexp)
user_re = re.compile(user_mask, re.I) user_re = re.compile(user_mask, re.I)
mask = r'<span foreground="%s">\1</span>' % (self.user_color) mask = r'<span foreground="%s">\1</span>' % (self.user_color)
@ -194,6 +195,7 @@ class MessageGrid(gtk.ScrolledWindow, gobject.GObject):
message_values['message']) message_values['message'])
# highlight groups # highlight groups
if data.group_regexp:
group_mask = '(%s)' % (data.group_regexp) group_mask = '(%s)' % (data.group_regexp)
group_re = re.compile(group_mask, re.I) group_re = re.compile(group_mask, re.I)
mask = r'<span foreground="%s">\1</span>' % (self.group_color) mask = r'<span foreground="%s">\1</span>' % (self.group_color)
@ -201,6 +203,7 @@ class MessageGrid(gtk.ScrolledWindow, gobject.GObject):
message_values['message']) message_values['message'])
# highlight tags # highlight tags
if data.tag_regexp:
tag_mask = '(%s)' % (data.tag_regexp) tag_mask = '(%s)' % (data.tag_regexp)
tag_re = re.compile(tag_mask, re.I) tag_re = re.compile(tag_mask, re.I)
mask = r'<span foreground="%s">\1</span>' % (self.tag_color) mask = r'<span foreground="%s">\1</span>' % (self.tag_color)

Loading…
Cancel
Save