Prechádzať zdrojové kódy

attr_assign partially works

Yentl Van Tendeloo 8 rokov pred
rodič
commit
c250bf6a3f
2 zmenil súbory, kde vykonal 4 pridanie a 0 odobranie
  1. 1 0
      wrappers/modelverse.py
  2. 3 0
      wrappers/test_modelverse.py

+ 1 - 0
wrappers/modelverse.py

@@ -454,6 +454,7 @@ def attr_assign(ID, attr, value):
     _input(ID)
     _input(ID)
     _input(attr)
     _input(attr)
     _input(value)
     _input(value)
+    _consume_to_end()
 
 
 def attr_assign_code(ID, attr, code):
 def attr_assign_code(ID, attr, code):
     """Assign a piece of Action Language code to the attribute"""
     """Assign a piece of Action Language code to the attribute"""

+ 3 - 0
wrappers/test_modelverse.py

@@ -43,3 +43,6 @@ except InvalidMode:
                 print(instantiate("T2P", ("t1", "p2")))
                 print(instantiate("T2P", ("t1", "p2")))
                 print(element_list())
                 print(element_list())
                 print(read_attrs("p1"))
                 print(read_attrs("p1"))
+                attr_assign("p1", "name", "abc")
+                attr_assign("p1", "tokens", 1)
+                print(read_attrs("p1"))