mirror of
https://github.com/evennia/evennia.git
synced 2026-03-16 21:06:30 +01:00
Make set command report modified/created. Resolves #1013.
This commit is contained in:
parent
bb577e563b
commit
faeb92f17d
1 changed files with 2 additions and 1 deletions
|
|
@ -1463,8 +1463,9 @@ class CmdSetAttribute(ObjManipCommand):
|
|||
|
||||
def set_attr(self, obj, attr, value):
|
||||
try:
|
||||
verb = "Modified" if obj.attributes.has(attr) else "Created"
|
||||
obj.attributes.add(attr, value)
|
||||
return "\nCreated attribute %s/%s = %s" % (obj.name, attr, repr(value))
|
||||
return "\n%s attribute %s/%s = %s" % (verb, obj.name, attr, repr(value))
|
||||
except SyntaxError:
|
||||
# this means literal_eval tried to parse a faulty string
|
||||
return ("\n|RCritical Python syntax error in your value. Only "
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue