From: Vincent Le Gallic Date: Mon, 13 Oct 2014 17:55:25 +0000 (+0200) Subject: Unicode fix ? X-Git-Url: http://gitweb.pimeys.fr/?a=commitdiff_plain;h=a34f731c8204d8a204ff85c0665a5b46e779d63b;p=bots%2Fparrot.git Unicode fix ? --- diff --git a/parrot.py b/parrot.py index 0cd5be9..c948dfe 100755 --- a/parrot.py +++ b/parrot.py @@ -502,7 +502,7 @@ class Parrot(ircbot.SingleServerIRCBot): victime = ev.arguments()[0] raison = ev.arguments()[1] if victime == self.nick: - log(self.serveur, "%s kické de %s par %s (raison : %s)" % (victime, channel, auteur, raison)) + log(self.serveur, ("%s kické de %s par %s (raison : %s)" % (victime, channel, auteur, raison)).decode("utf-8")) time.sleep(2) serv.join(channel) diff --git a/quotes.py b/quotes.py index f6e4bc3..39e048d 100644 --- a/quotes.py +++ b/quotes.py @@ -148,6 +148,7 @@ class QuoteDB(object): def random(self): """ Sort une quote aléatoire """ return random.choice(self.quotelist) + def quotesfrom(self, author): """ Sort toutes les quotes de ``author`` """ return [q for q in self.quotelist if q.author == author]