mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-02-20 07:30:54 +01:00
Added a bit more flushing.
This commit is contained in:
parent
6bd8d43c28
commit
92a04920cb
@ -76,9 +76,9 @@ class Later(callbacks.Privmsg):
|
|||||||
self._openNotes()
|
self._openNotes()
|
||||||
|
|
||||||
def die(self):
|
def die(self):
|
||||||
self._closeNotes()
|
self._flushNotes()
|
||||||
|
|
||||||
def _closeNotes(self):
|
def _flushNotes(self):
|
||||||
fd = utils.transactionalFile(self.filename)
|
fd = utils.transactionalFile(self.filename)
|
||||||
writer = csv.writer(fd)
|
writer = csv.writer(fd)
|
||||||
for (nick, notes) in self.notes.iteritems():
|
for (nick, notes) in self.notes.iteritems():
|
||||||
@ -118,6 +118,7 @@ class Later(callbacks.Privmsg):
|
|||||||
notes.append[(at, whence, text)]
|
notes.append[(at, whence, text)]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
self.notes[nick] = [(at, whence, text)]
|
self.notes[nick] = [(at, whence, text)]
|
||||||
|
self._flushNotes()
|
||||||
|
|
||||||
def tell(self, irc, msg, args):
|
def tell(self, irc, msg, args):
|
||||||
"""<nick> <text>
|
"""<nick> <text>
|
||||||
@ -139,6 +140,7 @@ class Later(callbacks.Privmsg):
|
|||||||
for (when, whence, note) in notes:
|
for (when, whence, note) in notes:
|
||||||
s = 'Sent %s: <%s> %s' % (self._timestamp(when), whence, note)
|
s = 'Sent %s: <%s> %s' % (self._timestamp(when), whence, note)
|
||||||
irc.reply(s, private=private)
|
irc.reply(s, private=private)
|
||||||
|
self._flushNotes()
|
||||||
except KeyError:
|
except KeyError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user