示例#1
0
 def _defer_for_context(context):
     _args = [convert_deferred(arg, context) for arg in args]
     _kwargs = {k: convert_deferred(v, context) for k, v in kwargs.iteritems()}
     _func = convert_deferred(func, context)
     retval = copy(context)
     retval['%'] = DeferredFunctionCall(fn=_func, args=_args, kwargs=_kwargs)
     return retval
示例#2
0
def _convert_deferred_merge(x, context):
    x = deepcopy(x)
    x._convert_leaf = lambda x: convert_deferred(x, Context())
    x._path = x._path._to_path(context)
    return DeferredMerge(x._convert(_deferred_context(context)))
示例#3
0
def _deferred_context(context):
    retval = copy(context)
    retval["%"] = convert_deferred(retval["%"], context)
    return retval