Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(2)  |  Call(2)  |  Derive(0)  |  Import(0)
Construct the final dictionary after resolving all references to get their actual values.

:param state: The is an instance of RenderState set up ready from the render process to begin.

:returns: A single dict representing the combination of all parts after references have been resolved.

        def render(state):
    """Construct the final dictionary after resolving all references to get their actual values.

    :param state: The is an instance of RenderState set up ready from the render process to begin.

    :returns: A single dict representing the combination of all parts after references have been resolved.

    """
    returned = {}
    derivefrom = {}

    for key, attr_or_ref in state.template.items():
        rc = hunt_n_resolve(attr_or_ref, state)

        # only check for derivefrom when its not {} if its present in state:
        if state.hasDeriveFrom() and not derivefrom:
            # We have a dict to derive from. This means the key, attr_or_ref
            # need to be removed in the final output.
            #print("has derive from. Removing from output: <%s:%s> " % (key, attr_or_ref))
            derivefrom = state.getDeriveFrom()

        else:
            # Replace the value as normal.
            returned[key] = rc

    if derivefrom:
        # Overwrite the rendered derivefrom with values from the main template
        # (if there are any shared keys). The derivefrom is a fully resolved
        # dict at this point
        #
        derivefrom.update(returned)
        returned = derivefrom

    return returned
        


src/b/o/boaconstructor-0.3.0/lib/boaconstructor/core.py   boaconstructor(Download)
        )
 
        return utils.render(state)
 
 

src/b/o/boaconstructor-0.3.0/lib/boaconstructor/tests/testboaconstructor.py   boaconstructor(Download)
            ext_refs={'common':common}
        )
        result = utils.render(state)
 
        correct = dict(