Exemple #1
0
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)
Exemple #2
0
    def setUp(self):
        self.root_node = tree.xml_string_to_tree(example_xml)
        collapse_resources(self.root_node)
        invert_method(self.root_node)

        self.resources = self.root_node.find_first("resources")
        self.method = self.root_node.find_first("method")
Exemple #3
0
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)
     collapse_resources(self.root_node)
     self.resource = self.root_node.find_first("resource")
 def setUp(self):
     self.root_node = tree.xml_string_to_tree(example_xml)
     collapse_resources(self.root_node)
     self.resource = self.root_node.find_first("resource")