[pybot-commits] CVS: pybot/pybot command.py,1.4,1.5
Brought to you by:
niemeyer
From: Gustavo N. <nie...@us...> - 2003-08-22 22:48:01
|
Update of /cvsroot/pybot/pybot/pybot In directory sc8-pr-cvs1:/tmp/cvs-serv3351/pybot Modified Files: command.py Log Message: Removed compatibility code from Command class. Index: command.py =================================================================== RCS file: /cvsroot/pybot/pybot/pybot/command.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** command.py 22 Aug 2003 13:22:11 -0000 1.4 --- command.py 22 Aug 2003 13:26:13 -0000 1.5 *************** *** 29,49 **** def setline(self, server=None, line=None): self.server = server - ## Maintaining temporarly for compatibility with old modules - tokens = split(line) - if len(tokens) == 0: - return - if tokens[0][0] == ":": - if len(tokens) == 1: - return - self.prefix = tokens[0][1:] - self.cmd = tokens[1] - self.params = tokens[2:] - else: - self.prefix = "" - self.cmd = tokens[0] - self.params = tokens[1:] - self.line = line - self._internalset() - ## m = self.re.match(line) if m: --- 29,32 ---- *************** *** 97,141 **** self.answered = 0 - def _internalset(self): - self.user.setstring(self.prefix) - if self.params: - self.target = self.params[0] - nick = self.server.user.nick - if len(self.params) > 1: - self.msg = [self.params[1][1:]] + self.params[2:] - self.rawmsg = self.msg[:] - punct = "" - while self.msg and self.msg[-1] and self.msg[-1][-1] in [".","!","?"]: - punct = self.msg[-1][-1] + punct - self.msg[-1] = self.msg[-1][:-1] - if not self.msg[-1]: - del self.msg[-1] - if punct: - self.msg.append(punct) - if re.compile("\W*%s\W*$"%nick).match(self.msg[0]): - del self.msg[0] - self.forme = 1 - else: - self.forme = 0 - else: - self.msg = [] - self.rawmsg = [] - self.forme = 0 - if self.target == nick: - self.forme = 1 - self.direct = 1 - self.answertarget = self.user.nick - else: - self.direct = 0 - self.answertarget = self.target - else: - self.target = "" - self.answertarget = "" - self.msg = [] - self.rawmsg = [] - self.forme = 0 - self.direct = 0 - self.answered = 0 - def answer(self, *params, **kw): self.server.sendmsg(self.answertarget, self.user.nick, *params, **kw) --- 80,83 ---- |