Made the inlinefunc->inlinefuncs error appear in a safer location since it could fall away in some common situations.

This commit is contained in:
Griatch 2016-04-26 09:14:26 +02:00
parent 644cf9451f
commit 01c6cbf5f0
2 changed files with 10 additions and 6 deletions

View file

@ -805,11 +805,6 @@ def error_check_python_modules():
imp(settings.BASE_ROOM_TYPECLASS)
imp(settings.BASE_EXIT_TYPECLASS)
imp(settings.BASE_SCRIPT_TYPECLASS)
# changed game dir settings file names
if os.path.isfile(os.path.join("server", "conf", "inlinefunc.py")):
raise DeprecationWarning("Name change: mygame/server/conf/inlinefunc.py should "
"be renamed to mygame/server/conf/inlinefuncs.py (note the S at the end)")
def init_game_directory(path, check_db=True):

View file

@ -166,7 +166,16 @@ _INLINE_FUNCS = {"nomatch": lambda *args, **kwargs: "<UKNOWN>",
# load custom inline func modules.
for module in utils.make_iter(settings.INLINEFUNC_MODULES):
_INLINE_FUNCS.update(utils.callables_from_module(module))
try:
_INLINE_FUNCS.update(utils.callables_from_module(module))
except ImportError as err:
if module == "server.conf.inlinefuncs":
# a temporary warning since the default module changed name
raise ImportError("Error: %s\nPossible reason: mygame/server/conf/inlinefunc.py should "
"be renamed to mygame/server/conf/inlinefuncs.py (note the S at the end)." % err)
else:
raise
# remove the core function if we include examples in this module itself
#_INLINE_FUNCS.pop("inline_func_parse", None)