Cleaned up @set to list attributes on an object and also to show attribute values without parsing their markup.
This commit is contained in:
parent
9c5f662196
commit
9520e261d8
1 changed files with 5 additions and 0 deletions
|
|
@ -1143,11 +1143,16 @@ class CmdSetAttribute(ObjManipCommand):
|
||||||
if not value:
|
if not value:
|
||||||
if self.rhs == None:
|
if self.rhs == None:
|
||||||
# no = means we inspect the attribute(s)
|
# no = means we inspect the attribute(s)
|
||||||
|
if not attrs:
|
||||||
|
attrs = [attr.key for attr in obj.get_all_attributes()]
|
||||||
for attr in attrs:
|
for attr in attrs:
|
||||||
if obj.has_attribute(attr):
|
if obj.has_attribute(attr):
|
||||||
string += "\nAttribute %s/%s = %s" % (obj.name, attr, obj.get_attribute(attr))
|
string += "\nAttribute %s/%s = %s" % (obj.name, attr, obj.get_attribute(attr))
|
||||||
else:
|
else:
|
||||||
string += "\n%s has no attribute '%s'." % (obj.name, attr)
|
string += "\n%s has no attribute '%s'." % (obj.name, attr)
|
||||||
|
# we view it without parsing markup.
|
||||||
|
self.caller.msg(string.strip(), data={"raw":True})
|
||||||
|
return
|
||||||
else:
|
else:
|
||||||
# deleting the attribute(s)
|
# deleting the attribute(s)
|
||||||
for attr in attrs:
|
for attr in attrs:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue