diff options
author | Johannes Löthberg <johannes@kyriasis.com> | 2014-07-15 16:03:50 +0200 |
---|---|---|
committer | Johannes Löthberg <johannes@kyriasis.com> | 2014-07-15 16:03:50 +0200 |
commit | 648c4cbc0fb133ff14335e5dddfc9844c881d321 (patch) | |
tree | e96b7621adc79b464f77359a0662094e4a230b74 | |
parent | 1de2463cb8455c504a5e594c2713cfa467b473a8 (diff) | |
download | dotfiles-648c4cbc0fb133ff14335e5dddfc9844c881d321.tar.xz |
weechat: colorize_nicks: updver 14 → 15
-rw-r--r-- | weechat/python/colorize_nicks.py | 6 |
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 |