aboutsummaryrefslogtreecommitdiffstats
path: root/weechat/python
diff options
context:
space:
mode:
authorJohannes Löthberg <johannes@kyriasis.com>2014-07-15 16:03:50 +0200
committerJohannes Löthberg <johannes@kyriasis.com>2014-07-15 16:03:50 +0200
commit648c4cbc0fb133ff14335e5dddfc9844c881d321 (patch)
treee96b7621adc79b464f77359a0662094e4a230b74 /weechat/python
parent1de2463cb8455c504a5e594c2713cfa467b473a8 (diff)
downloaddotfiles-648c4cbc0fb133ff14335e5dddfc9844c881d321.tar.xz
weechat: colorize_nicks: updver 14 → 15
Diffstat (limited to 'weechat/python')
-rw-r--r--weechat/python/colorize_nicks.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/weechat/python/colorize_nicks.py b/weechat/python/colorize_nicks.py
index d3730da..3f8f2c7 100644
--- a/weechat/python/colorize_nicks.py
+++ b/weechat/python/colorize_nicks.py
@@ -21,6 +21,8 @@
#
#
# History:
+# 2014-05-05, holomorph
+# version 15: fix python2-specific re.search check
# 2013-01-29, nils_2
# version 14: make script compatible with Python 3.x
# 2012-10-19, ldvx
@@ -60,7 +62,7 @@ w = weechat
SCRIPT_NAME = "colorize_nicks"
SCRIPT_AUTHOR = "xt <xt@bash.no>"
-SCRIPT_VERSION = "14"
+SCRIPT_VERSION = "15"
SCRIPT_LICENSE = "GPL"
SCRIPT_DESC = "Use the weechat nick colors in the chat area"
@@ -161,7 +163,7 @@ def colorize_cb(data, modifier, modifier_data, line):
# to address somebody
regex = r"(\A|\s).?(%s).?(\Z|\s)" % re.escape(nick)
match = re.search(regex, line)
- if str(type(match)) == "<type '_sre.SRE_Match'>":
+ if match is not None:
new_line = line[:match.start(2)] + nick_color+nick+reset + line[match.end(2):]
line = new_line
return line