|
@@ -761,6 +761,21 @@ def read_association_source(ID):
|
|
|
# raises UnknownError
|
|
|
# raises UnknownIdentifier
|
|
|
# raises NotAnAssociation
|
|
|
+ _input("read_association_source")
|
|
|
+ _output("Association to read source of?")
|
|
|
+ _input(ID)
|
|
|
+ if _output() == "Read source:":
|
|
|
+ result = _output()
|
|
|
+ _output("Please give your command.")
|
|
|
+ return result
|
|
|
+ elif _last_output() == "Unknown element; aborting":
|
|
|
+ _output("Please give your command.")
|
|
|
+ raise UnknownIdentifier()
|
|
|
+ elif _last_output() == "Not an association; aborting":
|
|
|
+ _output("Please give your command.")
|
|
|
+ raise NotAnEdge()
|
|
|
+ else:
|
|
|
+ raise InterfaceMismatch(_last_output())
|
|
|
|
|
|
def read_association_destination(ID):
|
|
|
"""Returns the destination of an association."""
|
|
@@ -769,6 +784,21 @@ def read_association_destination(ID):
|
|
|
# raises UnknownError
|
|
|
# raises UnknownIdentifier
|
|
|
# raises NotAnAssociation
|
|
|
+ _input("read_association_destination")
|
|
|
+ _output("Association to read destination of?")
|
|
|
+ _input(ID)
|
|
|
+ if _output() == "Read destination:":
|
|
|
+ result = _output()
|
|
|
+ _output("Please give your command.")
|
|
|
+ return result
|
|
|
+ elif _last_output() == "Unknown element; aborting":
|
|
|
+ _output("Please give your command.")
|
|
|
+ raise UnknownIdentifier()
|
|
|
+ elif _last_output() == "Not an association; aborting":
|
|
|
+ _output("Please give your command.")
|
|
|
+ raise NotAnEdge()
|
|
|
+ else:
|
|
|
+ raise InterfaceMismatch(_last_output())
|
|
|
|
|
|
def model_exit():
|
|
|
"""Leave model modify mode."""
|