Scripts and Exits updated. Fixed some deep issues with Scripts that caused object-based scripts to not properly shut down in some situations, as well as spawn multiple instances of themselves. I think this should resolve all "at_repeat doubling" issues reported. Due to optimizations in the typeclass cache loader in a previous update, the Exit cmdsets were not properly loaded (they were loaded at cache time, which now doesn't happen as often). So Exits instead rely on the new "at_cmdset_get" hook called by the cmdhandler. It allows dynamic modification of cmdsets just before they are accessed. Resolves issue173 (I hope). Resolves issue180. Resolves issue 181.

This commit is contained in:
Griatch 2011-08-11 21:16:35 +00:00
parent 16affc284b
commit 2b4e008d18
13 changed files with 135 additions and 68 deletions

View file

@ -102,8 +102,9 @@ class SharedMemoryModel(Model):
if instance._get_pk_val() is not None:
cls.__instance_cache__[instance._get_pk_val()] = instance
try:
object.__getattribute__(instance, "at_cache")()
except (TypeError, AttributeError):
object.__getattribute__(instance, "at_cache")()
except (TypeError, AttributeError), e:
#print e, instance._get_pk_val()
pass
#key = "%s-%s" % (cls, instance.pk)
@ -118,7 +119,7 @@ class SharedMemoryModel(Model):
def _flush_cached_by_key(cls, key):
del cls.__instance_cache__[key]
del cls.__instance_cache__[key]
_flush_cached_by_key = classmethod(_flush_cached_by_key)
def flush_cached_instance(cls, instance):