Merge remote branch 'origin/mjb/fix_init'
This commit is contained in:
commit
63a85fba3f
|
@ -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)')
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue