Some more removals of Attribute methods.

This commit is contained in:
Griatch 2013-08-25 17:09:03 +02:00
parent 8bd431b385
commit 48ddabdf25
2 changed files with 6 additions and 6 deletions

View file

@ -635,7 +635,7 @@ class CmdEditor(Command):
# hook save/load functions
def load_attr():
"inital loading of buffer data from given attribute."
target = self.obj.get_attribute(self.attrname)
target = self.obj.attributes.get(self.attrname)
if target != None and not isinstance(target, basestring):
typ = type(target).__name__
self.caller.msg("{RWARNING! Saving this buffer will overwrite the current attribute (of type %s) with a string!{n" % typ)

View file

@ -1291,15 +1291,15 @@ class TypedObject(SharedMemoryModel):
logger.log_depmsg("obj.attr() is deprecated. Use handlers obj.db or obj.attributes.")
if attribute_name == None:
# act as a list method
return self.get_all_attributes()
return _GA(self, "attributes").all()
elif delete == True:
self.del_attribute(attribute_name)
_GA(self, "attributes").remove(attribute_name)
elif value == None:
# act as a getter.
return self.get_attribute(attribute_name)
return _GA(self, "attributes").get(attribute_name)
else:
# act as a setter
self.set_attribute(attribute_name, value)
self._GA(self, "attributes").add(attribute_name, value)
def secure_attr(self, accessing_object, attribute_name=None, value=None, delete=False,
default_access_read=True, default_access_edit=True, default_access_create=True):
@ -1332,7 +1332,7 @@ class TypedObject(SharedMemoryModel):
return _GA(self, "attributes").get(attribute_name, accessing_obj=accessing_object, default_access=default_access_read)
else:
# act as setter
attr = self.get_attribute_obj(attribute_name)
attr = _GA(self, "attributes").get(attribute_name, return_obj=True)
if attr:
# attribute already exists
_GA(self, "attributes").add(attribute_name, value, accessing_obj=accessing_object, default_access=default_access_edit)