mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-10 20:22:36 +01:00
Merge pull request #376 from Digital-Lemon/testing
Network: Added @uptime && Irc.startedAt attribute
This commit is contained in:
commit
c31b6ed5c6
@ -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):
|
||||
"""[<network>]
|
||||
|
||||
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
|
||||
|
||||
|
@ -615,6 +615,7 @@ class Irc(IrcCommandDispatcher):
|
||||
self.zombie = False
|
||||
world.ircs.append(self)
|
||||
self.network = network
|
||||
self.startedAt = time.time()
|
||||
self.callbacks = callbacks
|
||||
self.state = IrcState()
|
||||
self.queue = IrcMsgQueue()
|
||||
|
Loading…
Reference in New Issue
Block a user