|
@@ -132,33 +132,10 @@ Element function modify(model : Element, write : Boolean):
|
|
|
else:
|
|
|
output("Permission denied")
|
|
|
|
|
|
- elif (cmd == "attr_modify"):
|
|
|
- if (write):
|
|
|
- String model_name
|
|
|
- output("Element to modify?")
|
|
|
- model_name = input()
|
|
|
- if (dict_in(model["model"], model_name)):
|
|
|
- Element attrs
|
|
|
- attrs = getAttributeList(model, model_name)
|
|
|
- String attr_name
|
|
|
- output("Attribute to modify?")
|
|
|
- attr_name = input()
|
|
|
- if (set_in(dict_keys(attrs), attr_name)):
|
|
|
- output("New value?")
|
|
|
- unset_attribute(model, model_name, attr_name)
|
|
|
- instantiate_attribute(model, model_name, attr_name, input())
|
|
|
- output("Modified!")
|
|
|
- else:
|
|
|
- output("No such attribute!")
|
|
|
- else:
|
|
|
- output("No such model!")
|
|
|
- else:
|
|
|
- output("Permission denied")
|
|
|
-
|
|
|
elif (cmd == "attr_add"):
|
|
|
if (write):
|
|
|
String model_name
|
|
|
- output("Which model do you want to assign an attribute to?")
|
|
|
+ output("Which element do you want to assign an attribute to?")
|
|
|
model_name = input()
|
|
|
if (dict_in(model["model"], model_name)):
|
|
|
Element attrs
|
|
@@ -173,14 +150,14 @@ Element function modify(model : Element, write : Boolean):
|
|
|
else:
|
|
|
output("No such attribute!")
|
|
|
else:
|
|
|
- output("No such model!")
|
|
|
+ output("No such element!")
|
|
|
else:
|
|
|
output("Permission denied")
|
|
|
|
|
|
elif (cmd == "attr_add_code"):
|
|
|
if (write):
|
|
|
String model_name
|
|
|
- output("Which model do you want to assign a coded attribute to?")
|
|
|
+ output("Which element do you want to assign a coded attribute to?")
|
|
|
model_name = input()
|
|
|
if (dict_in(model["model"], model_name)):
|
|
|
Element attrs
|
|
@@ -195,14 +172,14 @@ Element function modify(model : Element, write : Boolean):
|
|
|
else:
|
|
|
output("No such attribute!")
|
|
|
else:
|
|
|
- output("No such model!")
|
|
|
+ output("No such element!")
|
|
|
else:
|
|
|
output("Permission denied")
|
|
|
|
|
|
elif (cmd == "attr_del"):
|
|
|
if (write):
|
|
|
String model_name
|
|
|
- output("Which model do you want to remove an attribute of?")
|
|
|
+ output("Which element do you want to remove an attribute of?")
|
|
|
model_name = input()
|
|
|
if (dict_in(model["model"], model_name)):
|
|
|
Element attrs
|
|
@@ -216,7 +193,7 @@ Element function modify(model : Element, write : Boolean):
|
|
|
else:
|
|
|
output("No such attribute!")
|
|
|
else:
|
|
|
- output("No such model!")
|
|
|
+ output("No such element!")
|
|
|
else:
|
|
|
output("Permission denied")
|
|
|
|