Added elapsed command.

This commit is contained in:
Jeremy Fincher 2004-10-04 13:37:46 +00:00
parent 16c4561da6
commit 5526c4e298

View File

@ -46,7 +46,7 @@ import dateutil.parser
import supybot.conf as conf import supybot.conf as conf
import supybot.utils as utils import supybot.utils as utils
from supybot.commands import wrap from supybot.commands import *
import supybot.privmsgs as privmsgs import supybot.privmsgs as privmsgs
import supybot.registry as registry import supybot.registry as registry
import supybot.callbacks as callbacks import supybot.callbacks as callbacks
@ -178,6 +178,15 @@ class Time(callbacks.Privmsg):
irc.reply(time.strftime(format, time.localtime(seconds))) irc.reply(time.strftime(format, time.localtime(seconds)))
time = wrap(time, ['channel?', 'nonInt?', ('?int', TIME.time)]) time = wrap(time, ['channel?', 'nonInt?', ('?int', TIME.time)])
def elapsed(self, irc, msg, args, seconds):
"""<seconds>
Returns a pretty string that is the amount of time represented by
<seconds>.
"""
irc.reply(utils.timeElapsed(seconds))
elapsed = wrap(elapsed, ['int'])
Class = Time Class = Time