From 10a0fe9f9306786702e75e223fccbc87cbdc1233 Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Wed, 2 Apr 2003 07:50:35 +0000 Subject: [PATCH] Made uptime command not based on loading of FunCommands module. --- plugins/FunCommands.py | 3 +-- src/bot.py | 4 ++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/plugins/FunCommands.py b/plugins/FunCommands.py index 81a611a02..51ba3b140 100644 --- a/plugins/FunCommands.py +++ b/plugins/FunCommands.py @@ -95,7 +95,6 @@ class FunCommands(callbacks.Privmsg): self.recvdMsgs = 0 self.sentBytes = 0 self.recvdBytes = 0 - self._startTime = time.time() def inFilter(self, irc, msg): self.recvdMsgs += 1 @@ -309,7 +308,7 @@ class FunCommands(callbacks.Privmsg): def uptime(self, irc, msg, args): "takes no arguments" - elapsed = time.time() - self._startTime + elapsed = time.time() - world.startedAt days, elapsed = elapsed // 86400, elapsed % 86400 hours, elapsed = elapsed // 3600, elapsed % 3600 minutes, seconds = elapsed // 60, elapsed % 60 diff --git a/src/bot.py b/src/bot.py index 327e1095f..a9495b83c 100755 --- a/src/bot.py +++ b/src/bot.py @@ -36,14 +36,18 @@ Main program file for running the bot. from fix import * import sys +import time import email import getopt #import pprint import conf +import world sys.path.append(conf.pluginDir) +world.startedAt = time.time() + class ConfigurationDict(dict): def __init__(self, L=None): if L is not None: