hacked out loading of all modules from __init__

Discussion with bss implies that this is no longer needed, now that
the dynamic loader and unload is in place.

empirical testing seems to confirm this
This commit is contained in:
Mike Bloy 2010-12-17 22:46:48 -06:00
parent 1fe9575502
commit 8ffcecdff0
2 changed files with 2 additions and 21 deletions

View File

@ -147,7 +147,9 @@ try:
mods = cfgmodlist.split(',')
for mod in mods:
# try to load each module
mod = mod.strip()
modstr = 'modules.'+mod
print "DEBUG: attempting to load module %s" % (modstr)
__import__(modstr)
module = sys.modules[modstr]
botmod = eval('module.' + mod + '(config, server, modlist)')

View File

@ -1,25 +1,4 @@
import os
import sys
import glob
import re
files = glob.glob(os.path.dirname(__file__)+"/*.py")
__all__ = []
initre = re.compile('__init__')
for i in files:
if initre.search(i):
continue
i = os.path.basename(i)
lastDot = i.rfind(".")
i = i[0:lastDot]
__all__.append(i)
# This line is essentially: from i import *
__import__(i, locals(), globals(), ["*"])
__all__ = list(set(__all__))
# vi:tabstop=4:expandtab:autoindent
# kate: indent-mode python;indent-width 4;replace-tabs on;