From de89a9bf905944f4dcf946f518fb373b6c6fb248 Mon Sep 17 00:00:00 2001 From: Digital-Lemon Date: Sat, 30 Jun 2012 02:35:40 +0200 Subject: [PATCH] Added @network uptime --- plugins/Network/plugin.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/plugins/Network/plugin.py b/plugins/Network/plugin.py index 39e743de0..d1b75b7f3 100644 --- a/plugins/Network/plugin.py +++ b/plugins/Network/plugin.py @@ -317,6 +317,18 @@ class Network(callbacks.Plugin): irc.reply(otherIrc.driver.__class__.__module__[8:]) driver = wrap(driver, ['networkIrc']) + @internationalizeDocstring + def uptime(self, irc, msg, args, otherIrc): + """[] + + Returns the time duration since the connection was established. + """ + network = otherIrc.network + now = time.time() + started = otherIrc.startedAt + irc.reply(_("I've been connected to %s for %s.") % + (network, utils.timeElapsed(now - started))) + uptime = wrap(uptime, ['networkIrc']) Class = Network