Prettier format for latency.

This commit is contained in:
Jeremy Fincher 2004-09-13 13:45:19 +00:00
parent e473c53726
commit c6bec174c4

View File

@ -282,7 +282,7 @@ class Network(callbacks.Privmsg):
now = time.time() now = time.time()
if irc in self._latency: if irc in self._latency:
(replyIrc, when) = self._latency.pop(irc) (replyIrc, when) = self._latency.pop(irc)
replyIrc.reply('%s seconds.' % (now-when)) replyIrc.reply('%.2f seconds.' % (now-when))
def latency(self, irc, msg, args): def latency(self, irc, msg, args):
"""[<network>] """[<network>]
@ -293,7 +293,7 @@ class Network(callbacks.Privmsg):
""" """
network = self._getNetwork(irc, args) network = self._getNetwork(irc, args)
otherIrc = self._getIrc(network) otherIrc = self._getIrc(network)
otherIrc.queueMsg(ircmsgs.ping('Latency check.')) otherIrc.queueMsg(ircmsgs.ping('Latency check (from %s).' % msg.nick))
self._latency[otherIrc] = (irc, time.time()) self._latency[otherIrc] = (irc, time.time())
# XXX join # XXX join