mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
pep8
This commit is contained in:
parent
233395c0d4
commit
255fcce9e5
@ -126,7 +126,7 @@ def CATALOG_ENTRY(item, item_kind, base_href, version, updated,
|
||||
if item.id is not None:
|
||||
iid = 'I' + str(item.id)
|
||||
iid += ':'+item_kind
|
||||
link = NAVLINK(href = base_href + '/' + hexlify(iid))
|
||||
link = NAVLINK(href=base_href + '/' + hexlify(iid))
|
||||
count = (_('%d books') if item.count > 1 else _('%d book'))%item.count
|
||||
if ignore_count:
|
||||
count = ''
|
||||
@ -145,7 +145,7 @@ def CATALOG_ENTRY(item, item_kind, base_href, version, updated,
|
||||
def CATALOG_GROUP_ENTRY(item, category, base_href, version, updated):
|
||||
id_ = 'calibre:category-group:'+category+':'+item.text
|
||||
iid = item.text
|
||||
link = NAVLINK(href = base_href + '/' + hexlify(iid))
|
||||
link = NAVLINK(href=base_href + '/' + hexlify(iid))
|
||||
return E.entry(
|
||||
TITLE(item.text),
|
||||
ID(id_),
|
||||
@ -176,7 +176,7 @@ def ACQUISITION_ENTRY(item, version, db, updated, CFM, CKEYS, prefix):
|
||||
no_tag_count=True)))
|
||||
series = item[FM['series']]
|
||||
if series:
|
||||
extra.append(_('SERIES: %(series)s [%(sidx)s]<br />')%\
|
||||
extra.append(_('SERIES: %(series)s [%(sidx)s]<br />')%
|
||||
dict(series=xml(series),
|
||||
sidx=fmt_sidx(float(item[FM['series_index']]))))
|
||||
for key in CKEYS:
|
||||
@ -273,8 +273,8 @@ class TopLevel(Feed): # {{{
|
||||
updated, # datetime object in UTC
|
||||
categories,
|
||||
version,
|
||||
id_ = 'urn:calibre:main',
|
||||
subtitle = _('Books in your library')
|
||||
id_='urn:calibre:main',
|
||||
subtitle=_('Books in your library')
|
||||
):
|
||||
Feed.__init__(self, id_, updated, version, subtitle=subtitle)
|
||||
|
||||
@ -335,7 +335,6 @@ class CategoryGroupFeed(NavFeed):
|
||||
self.root.append(CATALOG_GROUP_ENTRY(item, which, base_href, version, updated))
|
||||
|
||||
|
||||
|
||||
class OPDSServer(object):
|
||||
|
||||
def add_routes(self, connect):
|
||||
@ -452,7 +451,6 @@ class OPDSServer(object):
|
||||
return str(CategoryFeed(items, category, id_, updated, version, offsets,
|
||||
page_url, up_url, self.db))
|
||||
|
||||
|
||||
def opds_navcatalog(self, which=None, version=0, offset=0):
|
||||
try:
|
||||
offset = int(offset)
|
||||
@ -563,7 +561,8 @@ class OPDSServer(object):
|
||||
raise cherrypy.HTTPError(404, 'Non id categories not supported')
|
||||
|
||||
q = category
|
||||
if q == 'news': q = 'tags'
|
||||
if q == 'news':
|
||||
q = 'tags'
|
||||
ids = self.db.get_books_for_category(q, which)
|
||||
sort_by = 'series' if category == 'series' else 'title'
|
||||
|
||||
@ -573,7 +572,6 @@ class OPDSServer(object):
|
||||
|
||||
# }}}
|
||||
|
||||
|
||||
def opds(self, version=0):
|
||||
version = int(version)
|
||||
if version not in BASE_HREFS:
|
||||
|
Loading…
x
Reference in New Issue
Block a user