Made the inlinefunc->inlinefuncs error appear in a safer location since it could fall away in some common situations.
This commit is contained in:
parent
644cf9451f
commit
01c6cbf5f0
2 changed files with 10 additions and 6 deletions
|
|
@ -805,11 +805,6 @@ def error_check_python_modules():
|
||||||
imp(settings.BASE_ROOM_TYPECLASS)
|
imp(settings.BASE_ROOM_TYPECLASS)
|
||||||
imp(settings.BASE_EXIT_TYPECLASS)
|
imp(settings.BASE_EXIT_TYPECLASS)
|
||||||
imp(settings.BASE_SCRIPT_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):
|
def init_game_directory(path, check_db=True):
|
||||||
|
|
|
||||||
|
|
@ -166,7 +166,16 @@ _INLINE_FUNCS = {"nomatch": lambda *args, **kwargs: "<UKNOWN>",
|
||||||
|
|
||||||
# load custom inline func modules.
|
# load custom inline func modules.
|
||||||
for module in utils.make_iter(settings.INLINEFUNC_MODULES):
|
for module in utils.make_iter(settings.INLINEFUNC_MODULES):
|
||||||
|
try:
|
||||||
_INLINE_FUNCS.update(utils.callables_from_module(module))
|
_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
|
# remove the core function if we include examples in this module itself
|
||||||
#_INLINE_FUNCS.pop("inline_func_parse", None)
|
#_INLINE_FUNCS.pop("inline_func_parse", None)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue