def execute_translations(ir, filename, samples_path): """Execute the translations against the IR""" # collapse nested resources into just the leaf node collapse_resources(ir) # resolve the internal references in the tree resolve_internal(ir) # make sure all the code elements are wrapped in samples wrap_code_elements(ir) # resolve the external code references path = os.path.abspath(os.path.dirname(filename)) resolve_external_code(path, ir, samples_path) # make the resources children of the methods invert_method(ir) # make sure the param nodes have good parents wrap_param_elements(ir) # make sure the response nodes have good parents wrap_response_elements(ir) # remove any resource type nodes cleanup_application_node(ir)
def execute_translations(ir, filename): """Execute the translations against the IR""" # collapse nested resources into just the leaf node collapse_resources(ir) # resolve the internal references in the tree resolve_internal(ir) # resolve the external code references path = os.path.abspath(os.path.dirname(filename)) resolve_external_code(path, ir) # make the resources children of the methods invert_method(ir) # make sure the param nodes have good parents wrap_param_elements(ir) # make sure the response nodes have good parents wrap_response_elements(ir) # remove any resource type nodes cleanup_application_node(ir)
def setUp(self): self.root_node = tree.xml_string_to_tree(example_xml) resolve_internal(self.root_node)