コード例 #1
0
ファイル: views.py プロジェクト: hirokiky/foomn
def expand(request):
    shortenkey = request.matchdict['shortenkey']
    try:
        url = expand_shortenkey(shortenkey)
    except (InvalidShortenKey, ShortenKeyDoesNotExist):
        raise HTTPNotFound

    return HTTPMovedPermanently(location=url)
コード例 #2
0
ファイル: test_shortenkey.py プロジェクト: hirokiky/foomn
 def _callFUT(self, *args, **kwargs):
     from foomn.shortenkey import expand_shortenkey
     return expand_shortenkey(*args, **kwargs)