mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 05:09:23 +01:00
Let's make sure to handle the situation when the Irc object isn't in self.connected.
This commit is contained in:
parent
74208016df
commit
efca3783c1
@ -78,13 +78,16 @@ class Status(callbacks.Privmsg):
|
||||
|
||||
Returns some interesting network-related statistics.
|
||||
"""
|
||||
elapsed = time.time() - self.connected[irc.getRealIrc()]
|
||||
try:
|
||||
elapsed = time.time() - self.connected[irc.getRealIrc()]
|
||||
timeElapsed = utils.timeElapsed(elapsed)
|
||||
except KeyError:
|
||||
timeElapsed = 'an indeterminate amount of time'
|
||||
irc.reply('I have received %s messages for a total of %s bytes. '
|
||||
'I have sent %s messages for a total of %s bytes. '
|
||||
'I have been connected to this network for %s.' %
|
||||
(self.recvdMsgs, self.recvdBytes,
|
||||
self.sentMsgs, self.sentBytes,
|
||||
utils.timeElapsed(elapsed)))
|
||||
self.sentMsgs, self.sentBytes, timeElapsed))
|
||||
|
||||
def cpu(self, irc, msg, args):
|
||||
"""takes no arguments
|
||||
|
Loading…
Reference in New Issue
Block a user