|
@@ -140,7 +140,11 @@ def _handle_output(requested=None, split=None):
|
|
|
if split is None:
|
|
|
return value
|
|
|
else:
|
|
|
- return value.strip().split(split, 1)[1].rstrip()
|
|
|
+ splitted = value.strip().split(split, 1)
|
|
|
+ if len(splitted) == 1:
|
|
|
+ return ""
|
|
|
+ else:
|
|
|
+ return splitted[1].rstrip()
|
|
|
else:
|
|
|
raise InterfaceMismatch(value)
|
|
|
|
|
@@ -254,6 +258,9 @@ def model_list():
|
|
|
raise InvalidMode()
|
|
|
_input("model_list")
|
|
|
output = _handle_output("Success: ", split=" ")
|
|
|
+ if output == "":
|
|
|
+ return []
|
|
|
+
|
|
|
lst = []
|
|
|
value = output.strip().split("\n")
|
|
|
for v in value:
|
|
@@ -355,6 +362,8 @@ def transformation_between(source, target):
|
|
|
|
|
|
_input(["transformation_between", source, target])
|
|
|
output = _handle_output("Success: ", split=" ")
|
|
|
+ if output == "":
|
|
|
+ return []
|
|
|
lst = [v for v in output.split("\n")]
|
|
|
|
|
|
def transformation_add_MT_language():
|
|
@@ -459,6 +468,8 @@ def element_list(model_name):
|
|
|
_input("list_full")
|
|
|
lst = []
|
|
|
output = _handle_output("Success: ", split=" ")
|
|
|
+ if output == "":
|
|
|
+ return []
|
|
|
for v in output.split("\n"):
|
|
|
m, mm = v.split(":")
|
|
|
m = m.strip()
|
|
@@ -482,6 +493,8 @@ def types(model_name):
|
|
|
_input("types")
|
|
|
lst = []
|
|
|
output = _handle_output("Success: ", split=" ")
|
|
|
+ if output == "":
|
|
|
+ return []
|
|
|
for v in output.split("\n"):
|
|
|
m, mm = v.split(":")
|
|
|
m = m.strip()
|
|
@@ -504,6 +517,8 @@ def types_full(model_name):
|
|
|
_input("types")
|
|
|
lst = []
|
|
|
output = _handle_output("Success: ", split=" ")
|
|
|
+ if output == "":
|
|
|
+ return []
|
|
|
for v in output.split("\n"):
|
|
|
m, mm = v.split(":")
|
|
|
m = m.strip()
|
|
@@ -686,7 +701,10 @@ def read_outgoing(model_name, ID, typename):
|
|
|
try:
|
|
|
_input(["read_outgoing", ID, typename])
|
|
|
output = _handle_output("Success: ", split=" ")
|
|
|
- return output.split("\n")
|
|
|
+ if output == "":
|
|
|
+ return []
|
|
|
+ else:
|
|
|
+ return output.split("\n")
|
|
|
finally:
|
|
|
model_exit()
|
|
|
|
|
@@ -704,7 +722,10 @@ def read_incoming(model_name, ID, typename):
|
|
|
try:
|
|
|
_input(["read_incoming", ID, typename])
|
|
|
output = _handle_output("Success: ", split=" ")
|
|
|
- return output.split("\n")
|
|
|
+ if output == "":
|
|
|
+ return []
|
|
|
+ else:
|
|
|
+ return output.split("\n")
|
|
|
finally:
|
|
|
model_exit()
|
|
|
|