Import the main module properly and fix some oddities in Twisted to prevent it from discarding some data
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
from core.main import *
|
||||
import main
|
||||
import modules.counters as count
|
||||
|
||||
class Stats:
|
||||
@@ -11,11 +11,11 @@ class Stats:
|
||||
stats = []
|
||||
numChannels = 0
|
||||
numWhoEntries = 0
|
||||
for i in IRCPool.keys():
|
||||
numChannels += len(IRCPool[i].channels)
|
||||
for i in wholist.keys():
|
||||
numWhoEntries += len(wholist[i].keys())
|
||||
stats.append("Servers: %s" % len(IRCPool.keys()))
|
||||
for i in main.IRCPool.keys():
|
||||
numChannels += len(main.IRCPool[i].channels)
|
||||
for i in main.wholist.keys():
|
||||
numWhoEntries += len(main.wholist[i].keys())
|
||||
stats.append("Servers: %s" % len(main.IRCPool.keys()))
|
||||
stats.append("Channels: %s" % numChannels)
|
||||
stats.append("User records: %s" % numWhoEntries)
|
||||
counterEvents = count.getEvents()
|
||||
@@ -34,13 +34,13 @@ class Stats:
|
||||
numWhoEntries = 0
|
||||
|
||||
failures = 0
|
||||
if spl[1] in IRCPool.keys():
|
||||
numChannels += len(IRCPool[spl[1]].channels)
|
||||
if spl[1] in main.IRCPool.keys():
|
||||
numChannels += len(main.IRCPool[spl[1]].channels)
|
||||
else:
|
||||
failure("Name does not exist: %s" % spl[1])
|
||||
failures += 1
|
||||
if spl[1] in wholist.keys():
|
||||
numWhoEntries += len(wholist[spl[1]].keys())
|
||||
if spl[1] in main.wholist.keys():
|
||||
numWhoEntries += len(main.wholist[spl[1]].keys())
|
||||
else:
|
||||
failure("Who entry does not exist: %s" % spl[1])
|
||||
failures += 1
|
||||
|
||||
Reference in New Issue
Block a user