Made typeclass loading a little more forgiving, adding a multitude of try-levels to fall back to in case of errors. Default is now to fallback to first settings-set default, then to the library default and only as a last resort fall back to the model. Every fallback step is logged. This should make the missing-hook error of #698 go away and report missing typeclasses in a better way.

This commit is contained in:
Griatch 2015-03-11 00:41:06 +01:00
parent c9ed8b5ec5
commit d752106906
5 changed files with 71 additions and 6 deletions

View file

@ -8,6 +8,7 @@ ability to run timers.
from twisted.internet.defer import Deferred, maybeDeferred
from twisted.internet.task import LoopingCall
from django.utils.translation import ugettext as _
from django.conf import settings
from evennia.typeclasses.models import TypeclassBase
from evennia.scripts.models import ScriptDB
from evennia.scripts.manager import ScriptManager
@ -140,6 +141,8 @@ class ScriptBase(ScriptDB):
"""
__metaclass__ = TypeclassBase
__settingsclasspath__ = settings.BASE_SCRIPT_TYPECLASS
__defaultclasspath__ = "evennia.scripts.scripts.DefaultScript"
objects = ScriptManager()