Import the main module properly and fix some oddities in Twisted to prevent it from discarding some data

This commit is contained in:
2018-03-14 20:13:40 +00:00
parent 5b1e3c6fb1
commit d168d69732
33 changed files with 370 additions and 318 deletions

View File

@@ -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