コード例 #1
0
ファイル: legacy.py プロジェクト: onyx-Sean/calibre
def browse(ctx, rd, rest):
    if rest.startswith('book/'):
        # implementation of https://bugs.launchpad.net/calibre/+bug/1698411
        # redirect old server book URLs to new URLs
        redirect = ctx.url_for(None) + '#book_id=' + rest[5:] + "&panel=book_details"
        from lxml import etree as ET
        return html(ctx, rd, endpoint,
                 E.html(E.head(
                     ET.XML('<meta http-equiv="refresh" content="0;url=' + redirect + '"/>'),
                     ET.XML('<script language="javascript">' +
                         'window.location.href = "' + redirect + '"' +
                         '</script>'
                         ))))
    else:
        raise HTTPRedirect(ctx.url_for(None))
コード例 #2
0
 def handler(data):
     raise HTTPRedirect('/somewhere-else')
コード例 #3
0
def stanza(ctx, rd, rest):
    raise HTTPRedirect(ctx.url_for('/opds'))
コード例 #4
0
ファイル: legacy.py プロジェクト: jilanfang/calibre
def mobile(ctx, rd, rest):
    raise HTTPRedirect(ctx.url_for(None))
コード例 #5
0
ファイル: legacy.py プロジェクト: jilanfang/calibre
def browse(ctx, rd, rest):
    raise HTTPRedirect(ctx.url_for(None))