From 671e1980b0d80ee0144add3f3cf0acea1af38d7a Mon Sep 17 00:00:00 2001 From: Vincent Le Gallic Date: Mon, 21 May 2012 03:57:15 +0200 Subject: [PATCH] =?utf8?q?Probl=C3=A8me=20sur=20les=20accents=20dans=20l'a?= =?utf8?q?nswer=5Fregexp?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- deconnaisseur.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/deconnaisseur.py b/deconnaisseur.py index 02310f7..688f11a 100755 --- a/deconnaisseur.py +++ b/deconnaisseur.py @@ -71,7 +71,9 @@ def reussi(message,answer,answer_regexp,auteur): if auteur in config_level2: return remplace_accents(answer) in message else: - return re.match(answer_regexp.lower(),remplace_accents(message).lower()) + print answer_regexp.lower(), remplace_accents(message).lower() + if re.match(remplace_accents(answer_regexp).lower(),remplace_accents(message).lower()): + return True def is_something(chain,matches,avant=u".*(?:^| )",apres=u"(?:$|\.| |,|;).*",case_sensitive=False,debug=False): if case_sensitive: @@ -346,7 +348,7 @@ class Deconnaisseur(ircbot.SingleServerIRCBot): elif cmd in ["states","status"]: if auteur in self.overops: for k in self.play_status.keys(): - serv.privmsg(auteur,(u"%s : %s"%(k,"; ".join([str(i) for i in self.play_status[k]]))).encode("utf8") ) + serv.privmsg(auteur,(u"%s : %s"%(k,"; ".join([unicode(i) for i in self.play_status[k]]))).encode("utf8") ) elif cmd=="say": if auteur in self.overops and len(message)>2: serv.privmsg(message[1]," ".join(message[2:])) -- 2.39.2