From 648c4cbc0fb133ff14335e5dddfc9844c881d321 Mon Sep 17 00:00:00 2001 From: Johannes Löthberg Date: Tue, 15 Jul 2014 16:03:50 +0200 Subject: weechat: colorize_nicks: updver 14 → 15 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- weechat/python/colorize_nicks.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'weechat') 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 " -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)) == "": + if match is not None: new_line = line[:match.start(2)] + nick_color+nick+reset + line[match.end(2):] line = new_line return line -- cgit v1.2.3-70-g09d2