Yeah, shouldn't have committed this without testing first.

This commit is contained in:
Jeremy Fincher 2004-08-05 04:15:33 +00:00
parent fdc8cdb15c
commit 4be774363a

View File

@ -39,6 +39,7 @@ __revision__ = "$Id$"
__author__ = "Daniel DiPaolo (Strike) <ddipaolo@users.sf.net>" __author__ = "Daniel DiPaolo (Strike) <ddipaolo@users.sf.net>"
import os import os
import csv
import time import time
import random import random
import itertools import itertools
@ -101,7 +102,7 @@ class FlatfileDunnoDB(DunnoDBInterface):
return csv.join(map(str, record)) return csv.join(map(str, record))
def deserialize(self, s): def deserialize(self, s):
L = csv.split(None, 2) L = csv.split(s)
L[0] = float(L[0]) L[0] = float(L[0])
L[1] = int(L[1]) L[1] = int(L[1])
return L return L
@ -262,8 +263,12 @@ class Dunno(callbacks.Privmsg):
irc.error('%r is not a valid dunno id.' % id) irc.error('%r is not a valid dunno id.' % id)
return return
try: try:
name = ircdb.users.getUser(id).name
(dunno, by, at) = self.db.get(channel, id) (dunno, by, at) = self.db.get(channel, id)
irc.reply("Dunno #%s: %r" % (id, dunno)) at = time.localtime(at)
timeStr = time.strftime(conf.supybot.humanTimestampFormat(), at)
irc.reply("Dunno #%s: %r (added by %s at %s)" % \
(id, dunno, name, timeStr))
except KeyError: except KeyError:
irc.error('No dunno found with that id.') irc.error('No dunno found with that id.')