mirror of
https://github.com/evennia/evennia.git
synced 2026-03-27 18:26:32 +01:00
Skip global scripts that cannot be 'imported' successfully, and log_err about it.
This commit is contained in:
parent
d58985da66
commit
d9bdabf4c1
1 changed files with 6 additions and 3 deletions
|
|
@ -202,14 +202,17 @@ class GlobalScriptContainer(Container):
|
|||
"""
|
||||
if self.typeclass_storage is None:
|
||||
self.typeclass_storage = {}
|
||||
for key, data in self.loaded_data.items():
|
||||
for key, data in list(self.loaded_data.items()):
|
||||
try:
|
||||
typeclass = data.get("typeclass", settings.BASE_SCRIPT_TYPECLASS)
|
||||
self.typeclass_storage[key] = class_from_module(typeclass)
|
||||
except Exception:
|
||||
logger.log_trace(
|
||||
f"GlobalScriptContainer could not start import global script {key}."
|
||||
logger.log_err(
|
||||
f"GlobalScriptContainer could not start import global script {key}. "
|
||||
"It will be removed (skipped)."
|
||||
)
|
||||
# Let's remove this key/value. We want to let other scripts load.
|
||||
self.loaded_data.pop(key)
|
||||
|
||||
def get(self, key, default=None):
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue