From cc2780b78a39230cafcf1c3b397c79831fde8153 Mon Sep 17 00:00:00 2001 From: GLolol Date: Thu, 1 Jan 2015 00:00:25 -0500 Subject: [PATCH] Time.time: simply channel-handling code for getting formats --- plugins/Time/plugin.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/plugins/Time/plugin.py b/plugins/Time/plugin.py index 974dd7295..4509f5085 100644 --- a/plugins/Time/plugin.py +++ b/plugins/Time/plugin.py @@ -159,7 +159,7 @@ class Time(callbacks.Plugin): TIME.time)]) @internationalizeDocstring - def time(self, irc, msg, args, channel, format, seconds): + def time(self, irc, msg, args, format, seconds): """[] [] Returns the current time in format, or, if is not @@ -167,10 +167,7 @@ class Time(callbacks.Plugin): time is given, the current time is used. """ if not format: - if channel: - format = self.registryValue('format', channel) - else: - format = self.registryValue('format') + format = self.registryValue('format', msg.args[0]) if tzlocal: irc.reply(datetime.fromtimestamp(seconds, tzlocal()).strftime(format)) else: @@ -178,8 +175,7 @@ class Time(callbacks.Plugin): # including at least up to 2.7.5 and 3.2.3. Install dateutil if you # can't upgrade Python. irc.reply(time.strftime(format, time.localtime(seconds))) - time = wrap(time, [optional('channel'), optional('nonInt'), - additional('float', TIME.time)]) + time = wrap(time, [optional('nonInt'), additional('float', TIME.time)]) @internationalizeDocstring def elapsed(self, irc, msg, args, seconds):