def view(tpl_name, **defaults):

    def decorator(func):

        @functools.wraps(func)
        def wrapper(*args, **kwargs):
            result = func(*args, **kwargs)
            if isinstance(result, (dict, DictMixin)):
                tplvars = defaults.copy()
                tplvars.update(result)
                return template(tpl_name, **tplvars)
            elif result is None:
                return template(tpl_name, defaults)
            return result

        return wrapper

    return decorator
Reads a pkt-line from the remote git process.
dataset/ETHPy150Open Arelle/Arelle/arelle/webserver/bottle.py/view--crossover with--dataset/ETHPy150Open natestedman/Observatory/observatory/lib/dulwich/protocol.py/Protocol.read_pkt_line