You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
605 B
23 lines
605 B
13 years ago
|
import os
|
||
|
import botconfig
|
||
|
|
||
|
MODULES = {}
|
||
|
|
||
|
for modfile in os.listdir("modules"):
|
||
|
if modfile == "common.py":
|
||
|
continue # no need to load this one
|
||
|
if modfile.startswith("__"):
|
||
|
continue
|
||
|
if not modfile.endswith(".py"):
|
||
|
continue # not a module
|
||
|
if not os.path.isfile("modules/"+modfile):
|
||
|
continue # not a file
|
||
|
|
||
|
modfile = modfile[:-3]
|
||
|
MODULES[modfile] = getattr(__import__("modules."+modfile), modfile)
|
||
|
|
||
|
if botconfig.DEFAULT_MODULE in MODULES.keys():
|
||
|
CURRENT_MODULE = botconfig.DEFAULT_MODULE.lower()
|
||
|
else:
|
||
|
CURRENT_MODULE = "wolfgame"
|