Преглед на файлове

Implemented connections_between in wrapper

Yentl Van Tendeloo преди 8 години
родител
ревизия
37f0b937a9
променени са 1 файла, в които са добавени 8 реда и са изтрити 1 реда
  1. 8 1
      wrappers/modelverse.py

+ 8 - 1
wrappers/modelverse.py

@@ -917,7 +917,14 @@ def element_list_nice(model_name):
 
 def connections_between(model_name, source_element, target_element):
     """Gets a list of all allowed connections between the source and target element in the model."""
-    raise NotImplementedError()
+    _goto_mode(MODE_MODIFY, model_name)
+
+    _input(["connections_between", source_element, target_element])
+    output = _handle_output("Success: ", split=" ")
+    if output == "":
+        return set([])
+    else:
+        return set(output.split("\n"))
 
 def define_attribute(model_name, node, attr_name, attr_type):
     """Create a new attribute, which can be instantiated one meta-level below."""