mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-02-18 14:40:51 +01:00
Provide a proper response for Later.notes when no notes are waiting.
This commit is contained in:
parent
70d1b1d5d0
commit
de7d0fae74
@ -80,7 +80,7 @@ class Later(callbacks.Privmsg):
|
|||||||
return utils.timeElapsed(diff, seconds=False) + ' ago'
|
return utils.timeElapsed(diff, seconds=False) + ' ago'
|
||||||
except ValueError:
|
except ValueError:
|
||||||
return 'just now'
|
return 'just now'
|
||||||
|
|
||||||
def _addNote(self, nick, whence, text, at=None, maximum=None):
|
def _addNote(self, nick, whence, text, at=None, maximum=None):
|
||||||
if at is None:
|
if at is None:
|
||||||
at = time.time()
|
at = time.time()
|
||||||
@ -97,7 +97,7 @@ class Later(callbacks.Privmsg):
|
|||||||
if '?' in nick or '*' in nick and nick not in self.wildcards:
|
if '?' in nick or '*' in nick and nick not in self.wildcards:
|
||||||
self.wildcards.append(nick)
|
self.wildcards.append(nick)
|
||||||
self._flushNotes()
|
self._flushNotes()
|
||||||
|
|
||||||
def tell(self, irc, msg, args, nick, text):
|
def tell(self, irc, msg, args, nick, text):
|
||||||
"""<nick> <text>
|
"""<nick> <text>
|
||||||
|
|
||||||
@ -130,10 +130,14 @@ class Later(callbacks.Privmsg):
|
|||||||
irc.error('I have no notes for that nick.')
|
irc.error('I have no notes for that nick.')
|
||||||
else:
|
else:
|
||||||
nicks = self._notes.keys()
|
nicks = self._notes.keys()
|
||||||
utils.sortBy(ircutils.toLower, nicks)
|
if nicks:
|
||||||
irc.reply(format('I currently have notes waiting for %L.', nicks))
|
utils.sortBy(ircutils.toLower, nicks)
|
||||||
|
irc.reply(format('I currently have notes waiting for %L.',
|
||||||
|
nicks))
|
||||||
|
else:
|
||||||
|
irc.error('I have no notes waiting to be delivered.')
|
||||||
notes = wrap(notes, [additional('something')])
|
notes = wrap(notes, [additional('something')])
|
||||||
|
|
||||||
def doPrivmsg(self, irc, msg):
|
def doPrivmsg(self, irc, msg):
|
||||||
notes = self._notes.pop(msg.nick, [])
|
notes = self._notes.pop(msg.nick, [])
|
||||||
# Let's try wildcards.
|
# Let's try wildcards.
|
||||||
@ -154,7 +158,7 @@ class Later(callbacks.Privmsg):
|
|||||||
|
|
||||||
def _formatNote(self, when, whence, note):
|
def _formatNote(self, when, whence, note):
|
||||||
return 'Sent %s: <%s> %s' % (self._timestamp(when), whence, note)
|
return 'Sent %s: <%s> %s' % (self._timestamp(when), whence, note)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Class = Later
|
Class = Later
|
||||||
|
Loading…
x
Reference in New Issue
Block a user