

def url_for(self, fn, **kwargs):
    if (not callable(fn)):
        raise RouterException('router url_for method only accept callable object.')
    for (rule, v) in self.rulesMap.items():
        if (v == fn):
            if (len(kwargs.variables) > 0):
                return rule.build_url(kwargs)
            return rule.build_url()
    raise RouterException("callable object doesn't matched any routing rule.")

dataset/ETHPy150Open jasonlvhit/lunar/lunar/router.py Router.url_for/VarMisuse@63/86 `rule`->`kwargs`