示例#1
0
def _download_popup(provider, book_id, formats, requested_formats):
    items = [("Download in:", "", True, False, False)]
    for format, version_id in formats:
        if format not in requested_formats: continue
        link = _download_link(provider, book_id, format, version_id)
        items.append(("  %s format" % format, link, False, False, False))
    if len(items) == 1:
        return None
    return popupMenu.buildPopupMenu(items)
示例#2
0
def _author_link(author, modulesInfo):
    items = [
        ("eBooks by %s" % author, create_search_author_link(author), False, True, False)
    ]
    if modulesInfo["Encyclopedia"]:
        items.append(("Search in Encyclopedia", encyclopedia.create_search_link(author), False, False, False))
    if modulesInfo["Amazon"]:
        items.append(("Search in Amazon", "s+amazonsearch:Books;;1;%s" % author, False, False, False))
    return popupMenu.buildPopupMenu(items)
示例#3
0
def _title_link(title, modulesInfo):
    items = []
    if modulesInfo["Encyclopedia"]:
        items.append(("Search in Encyclopedia", encyclopedia.create_search_link(title), False, False, False))
    if modulesInfo["Amazon"]:
        items.append(("Search in Amazon", "s+amazonsearch:Books;;1;%s" % title, False, False, False))

    if 0 != len(items):
        return popupMenu.buildPopupMenu(items)
    return None