Merge remote branch 'origin/mjb/fix_init'

This commit is contained in:
Brian S. Stephan 2010-12-24 13:27:33 -06:00
commit 63a85fba3f
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;