From 92a04920cb2ff87c9bc5ea4087573f07049cc965 Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Wed, 11 Aug 2004 04:57:55 +0000 Subject: [PATCH] Added a bit more flushing. --- plugins/Later.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/Later.py b/plugins/Later.py index 287ee9de7..d6c482325 100644 --- a/plugins/Later.py +++ b/plugins/Later.py @@ -76,9 +76,9 @@ class Later(callbacks.Privmsg): self._openNotes() def die(self): - self._closeNotes() + self._flushNotes() - def _closeNotes(self): + def _flushNotes(self): fd = utils.transactionalFile(self.filename) writer = csv.writer(fd) for (nick, notes) in self.notes.iteritems(): @@ -118,6 +118,7 @@ class Later(callbacks.Privmsg): notes.append[(at, whence, text)] except KeyError: self.notes[nick] = [(at, whence, text)] + self._flushNotes() def tell(self, irc, msg, args): """ @@ -139,6 +140,7 @@ class Later(callbacks.Privmsg): for (when, whence, note) in notes: s = 'Sent %s: <%s> %s' % (self._timestamp(when), whence, note) irc.reply(s, private=private) + self._flushNotes() except KeyError: pass