Further caching and optimization, making some operations noticeable faster in the end.

This commit is contained in:
Griatch 2012-04-26 17:47:25 +02:00
parent 1a6ef5d983
commit 6e08c011a1
13 changed files with 78 additions and 73 deletions

View file

@ -91,6 +91,8 @@ class TypeClass(object):
transparently include the properties on
self.dbobj. Note that dbobj properties have
priority, so if you define a same-named
property on the class, it will NOT be
accessible through getattr.
"""
@ -115,8 +117,8 @@ class TypeClass(object):
try:
return _GA(dbobj,"get_attribute_raise")(propname)
except AttributeError:
string = "Object: '%s' not found on %s(%s), nor on its typeclass %s."
raise AttributeError(string % (propname, dbobj, dbobj.dbref, dbobj.typeclass_path))
string = "Object: '%s' not found on %s(#%s), nor on its typeclass %s."
raise AttributeError(string % (propname, dbobj, dbobj.dbid, dbobj.typeclass_path))
def __setattr__(self, propname, value):
"""
@ -185,9 +187,9 @@ class TypeClass(object):
try:
dbobj.del_attribute_raise(propname)
except AttributeError:
string = "Object: '%s' not found on %s(%s), nor on its typeclass %s."
string = "Object: '%s' not found on %s(#%s), nor on its typeclass %s."
raise AttributeError(string % (propname, dbobj,
dbobj.dbref,
dbobj.dbid,
dbobj.typeclass_path,))
def __str__(self):