Procházet zdrojové kódy

Implement element_list_nice

Yentl Van Tendeloo před 8 roky
rodič
revize
a29de51a1f
1 změnil soubory, kde provedl 7 přidání a 2 odebrání
  1. 7 2
      wrappers/modelverse.py

+ 7 - 2
wrappers/modelverse.py

@@ -423,7 +423,7 @@ def model_render(model_name, mapper_name):
     _goto_mode(MODE_MODELLING)
 
     _input(["model_render", model_name, mapper_name])
-    return _handle_output("Success: ", split=" ")
+    return json.loads(_handle_output("Success: ", split=" "))
 
 def transformation_between(source, target):
     _goto_mode(MODE_MODELLING)
@@ -939,7 +939,12 @@ def transformation_read_signature(transformation):
 
 def element_list_nice(model_name):
     """Fetches a nice representation of models."""
-    raise NotImplementedError()
+    _goto_mode(MODE_MODELLING)
+
+    global registered_metamodels
+    _input(["element_list_nice", model_name, registered_metamodels[model_name]])
+
+    return json.loads(_handle_output("Success: ", split=" "))
 
 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."""