|
@@ -712,16 +712,23 @@ def read_outgoing(ID, typename):
|
|
|
# return [name1, name2, ...]
|
|
|
# raises UnknownError
|
|
|
# raises UnknownIdentifier
|
|
|
- # raises UnknownType
|
|
|
if mode != 3:
|
|
|
raise InvalidMode()
|
|
|
+
|
|
|
_input("read_outgoing")
|
|
|
+ _output("Element to read from?")
|
|
|
_input(ID)
|
|
|
- _input(typename)
|
|
|
- lst = []
|
|
|
- while (_output() != "Please give your command."):
|
|
|
- lst.append(_last_output())
|
|
|
- return lst
|
|
|
+ if _output() == "Type of outgoing edge (empty for all)?":
|
|
|
+ _input(typename)
|
|
|
+ lst = []
|
|
|
+ while (_output() != "Please give your command."):
|
|
|
+ lst.append(_last_output())
|
|
|
+ return lst
|
|
|
+ elif _last_output() == "Unknown element; aborting":
|
|
|
+ _output("Please give your command.")
|
|
|
+ raise UnknownIdentifier()
|
|
|
+ else:
|
|
|
+ raise InterfaceMismatch()
|
|
|
|
|
|
def read_incoming(ID, typename):
|
|
|
"""Returns a list of all incoming associations of a specific type ("" = all)"""
|
|
@@ -731,13 +738,21 @@ def read_incoming(ID, typename):
|
|
|
# raises UnknownType
|
|
|
if mode != 3:
|
|
|
raise InvalidMode()
|
|
|
+
|
|
|
_input("read_incoming")
|
|
|
+ _output("Element to read from?")
|
|
|
_input(ID)
|
|
|
- _input(typename)
|
|
|
- lst = []
|
|
|
- while (_output() != "Please give your command."):
|
|
|
- lst.append(_last_output())
|
|
|
- return lst
|
|
|
+ if _output() == "Type of incoming edge (empty for all)?":
|
|
|
+ _input(typename)
|
|
|
+ lst = []
|
|
|
+ while (_output() != "Please give your command."):
|
|
|
+ lst.append(_last_output())
|
|
|
+ return lst
|
|
|
+ elif _last_output() == "Unknown element; aborting":
|
|
|
+ _output("Please give your command.")
|
|
|
+ raise UnknownIdentifier()
|
|
|
+ else:
|
|
|
+ raise InterfaceMismatch()
|
|
|
|
|
|
def read_association_source(ID):
|
|
|
"""Returns the source of an association."""
|