def expand(request): shortenkey = request.matchdict['shortenkey'] try: url = expand_shortenkey(shortenkey) except (InvalidShortenKey, ShortenKeyDoesNotExist): raise HTTPNotFound return HTTPMovedPermanently(location=url)
def _callFUT(self, *args, **kwargs): from foomn.shortenkey import expand_shortenkey return expand_shortenkey(*args, **kwargs)