From 255fcce9e5d7bb2dc8d4a0b3ee76a213601bf655 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 7 Sep 2013 16:47:25 +0530 Subject: [PATCH] pep8 --- src/calibre/library/server/opds.py | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/calibre/library/server/opds.py b/src/calibre/library/server/opds.py index 56e0067abc..7dd07c064e 100644 --- a/src/calibre/library/server/opds.py +++ b/src/calibre/library/server/opds.py @@ -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]
')%\ + extra.append(_('SERIES: %(series)s [%(sidx)s]
')% dict(series=xml(series), sidx=fmt_sidx(float(item[FM['series_index']])))) for key in CKEYS: @@ -231,7 +231,7 @@ def ACQUISITION_ENTRY(item, version, db, updated, CFM, CKEYS, prefix): # }}} -class Feed(object): # {{{ +class Feed(object): # {{{ def __init__(self, id_, updated, version, subtitle=None, title=__appname__ + ' ' + _('Library'), @@ -267,14 +267,14 @@ class Feed(object): # {{{ xml_declaration=True) # }}} -class TopLevel(Feed): # {{{ +class TopLevel(Feed): # {{{ def __init__(self, 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: