diff options
author | Florent Le Coz <louiz@louiz.org> | 2011-02-10 11:49:25 +0100 |
---|---|---|
committer | Florent Le Coz <louiz@louiz.org> | 2011-02-10 11:49:25 +0100 |
commit | 538c843ec704fea18107f875aad0e14eebd1875e (patch) | |
tree | d7128eabf2d34f4d15eb42541e4fa8774143481d | |
parent | d31f1390ad85caab806677022f9d510715663923 (diff) | |
download | poezio-538c843ec704fea18107f875aad0e14eebd1875e.tar.gz poezio-538c843ec704fea18107f875aad0e14eebd1875e.tar.bz2 poezio-538c843ec704fea18107f875aad0e14eebd1875e.tar.xz poezio-538c843ec704fea18107f875aad0e14eebd1875e.zip |
Remove a useless UnicodeError check
-rw-r--r-- | src/room.py | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/src/room.py b/src/room.py index 1613ecee..9bb9f721 100644 --- a/src/room.py +++ b/src/room.py @@ -59,22 +59,14 @@ class Room(TextBuffer): Set the tab color and returns the txt color """ color = theme.COLOR_NORMAL_TEXT - if not time and nickname and nickname != self.own_nick and self.joined: # do the highlight - try: - if self.own_nick in txt: - self.set_color_state(theme.COLOR_TAB_HIGHLIGHT) - color = theme.COLOR_HIGHLIGHT_TEXT - except UnicodeDecodeError: - try: - if self.own_nick in txt: - self.set_color_state(theme.COLOR_TAB_HIGHLIGHT) - color = theme.COLOR_HIGHLIGHT_TEXT - except: - pass + if not time and nickname and nickname != self.own_nick and self.joined: + if self.own_nick in txt: + self.set_color_state(theme.COLOR_TAB_HIGHLIGHT) + color = theme.COLOR_HIGHLIGHT_TEXT else: highlight_words = config.get('highlight_on', '').split(':') for word in highlight_words: - if word.lower() in txt.lower() and word != '': + if word and word.lower() in txt.lower(): self.set_color_state(theme.COLOR_TAB_HIGHLIGHT) color = theme.COLOR_HIGHLIGHT_TEXT break |