plugins/Time: Make sure the Time commands are nested-safe, i.e. they reply with strings.

This commit is contained in:
James Vega 2005-05-22 21:01:16 +00:00
parent ff2eb7daa9
commit aeaad9056c
2 changed files with 6 additions and 1 deletions

View File

@ -112,7 +112,7 @@ class Time(callbacks.Plugin):
if new != now: if new != now:
if new - now < 0: if new - now < 0:
new += 86400 new += 86400
irc.reply(new-now) irc.reply(str(new-now))
else: else:
irc.error('That\'s right now!') irc.error('That\'s right now!')
until = wrap(until, ['text']) until = wrap(until, ['text'])

View File

@ -51,6 +51,11 @@ class TimeTestCase(PluginTestCase):
self.assertNotError('ctime') self.assertNotError('ctime')
self.assertNotError('time %Y') self.assertNotError('time %Y')
def testNoNestedErrors(self):
self.assertNotError('echo [until 4:00]')
self.assertNotError('echo [at now]')
self.assertNotError('echo [seconds 4m]')
# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79: # vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79: