From c7d2227e2dba9371be3e1e710f28ababdbad67fa Mon Sep 17 00:00:00 2001 From: Vincent Le Gallic Date: Sun, 23 Nov 2014 05:35:29 +0100 Subject: [PATCH] =?utf8?q?On=20enregistre=20des=20infos=20quand=20on=20dem?= =?utf8?q?ande=20un=20whois=20(qui=20l'a=20demand=C3=A9,=20pourquoi?= =?utf8?q?=E2=80=A6)=20et=20on=20m=C3=A9morise=20qu'on=20est=20en=20train?= =?utf8?q?=20d'attendre=20la=20r=C3=A9ponse?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- basile.py | 5 +++-- users.py | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/basile.py b/basile.py index 86917a4..9b53b1a 100755 --- a/basile.py +++ b/basile.py @@ -211,8 +211,9 @@ class Basile(ircbot.SingleServerIRCBot): self.serv.privmsg(place, message) log(self.serveur, place, auteur, something + "%r" % params + ("[successful]" if success else "[failed]")) - def whois(self, pseudo): + def whois(self, pseudo, askedwhy, askedby): """Demande un whois sur ``pseudo``. La réponse sera handled par une autre fonction.""" + self.users.pending_whois[pseudo] = ["pending", askedwhy, askedby] self.serv.whois([pseudo]) ### Surcharge des events du Bot @@ -475,7 +476,7 @@ class Basile(ircbot.SingleServerIRCBot): notunderstood = True elif cmd == u"whois": if auteur in self.ops and len(message) > 1: - self.whois(message[1]) + self.whois(message[1], askedwhy="cmd WHOIS", askedby=auteur) else: notunderstood = True else: diff --git a/users.py b/users.py index 368f978..b4a782c 100644 --- a/users.py +++ b/users.py @@ -55,6 +55,7 @@ class UserDB(object): """ Stocke et distribue des utilisateurs. """ def __init__(self): self.userlist = [] + self.pending_whois = {} def load(self): """ Charge le fichier d'utilisateurs dans la DB """ -- 2.39.2