Removed the conf/ modules, putting them into conf/examples instead, in line with other API changes. The gamesrc/ folder is now completely empty and all new modules have to be added explicitly.

This commit is contained in:
Griatch 2012-03-25 19:52:51 +02:00
parent bdb5ab0123
commit e042366f31
11 changed files with 72 additions and 30 deletions

View file

@ -566,6 +566,8 @@ def mod_import(mod_path, propname=None):
for line in errmsg.splitlines():
log.msg('[EE] %s' % line)
if not mod_path:
return None
# first try to import as a python path
try:
mod = __import__(mod_path, fromlist=["None"])
@ -610,6 +612,8 @@ def variable_from_module(modpath, variable, default=None):
If module cannot be imported or variable not found, default
is returned.
"""
if not modpath:
return None
try:
mod = __import__(modpath, fromlist=["None"])
return mod.__dict__.get(variable, default)