mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 10:44:09 -04:00
pep8
This commit is contained in:
parent
0fd842dd9a
commit
b1f17de41c
@ -117,7 +117,6 @@ class AjaxServer(object):
|
|||||||
# Search
|
# Search
|
||||||
connect('ajax_search', base_href+'/search', self.ajax_search)
|
connect('ajax_search', base_href+'/search', self.ajax_search)
|
||||||
|
|
||||||
|
|
||||||
# Get book metadata {{{
|
# Get book metadata {{{
|
||||||
def ajax_book_to_json(self, book_id, get_category_urls=True,
|
def ajax_book_to_json(self, book_id, get_category_urls=True,
|
||||||
device_compatible=False):
|
device_compatible=False):
|
||||||
@ -214,7 +213,7 @@ class AjaxServer(object):
|
|||||||
book_id = int(book_id)
|
book_id = int(book_id)
|
||||||
data, last_modified = self.ajax_book_to_json(book_id,
|
data, last_modified = self.ajax_book_to_json(book_id,
|
||||||
get_category_urls=category_urls.lower()=='true',
|
get_category_urls=category_urls.lower()=='true',
|
||||||
device_compatible=device_compatible.lower()=='true');
|
device_compatible=device_compatible.lower()=='true')
|
||||||
except:
|
except:
|
||||||
raise cherrypy.HTTPError(404, 'No book with id: %r'%book_id)
|
raise cherrypy.HTTPError(404, 'No book with id: %r'%book_id)
|
||||||
|
|
||||||
@ -291,7 +290,6 @@ class AjaxServer(object):
|
|||||||
|
|
||||||
displayed_custom_fields = custom_fields_to_display(self.db)
|
displayed_custom_fields = custom_fields_to_display(self.db)
|
||||||
|
|
||||||
|
|
||||||
for category in sorted(categories, key=lambda x: sort_key(getter(x))):
|
for category in sorted(categories, key=lambda x: sort_key(getter(x))):
|
||||||
if len(categories[category]) == 0:
|
if len(categories[category]) == 0:
|
||||||
continue
|
continue
|
||||||
@ -505,7 +503,6 @@ class AjaxServer(object):
|
|||||||
'items':items,
|
'items':items,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
# Books in the specified category {{{
|
# Books in the specified category {{{
|
||||||
@ -569,7 +566,6 @@ class AjaxServer(object):
|
|||||||
'book_ids':ids
|
'book_ids':ids
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
# Search {{{
|
# Search {{{
|
||||||
|
@ -31,7 +31,6 @@ class Cache(object):
|
|||||||
self._search_cache[search] = old
|
self._search_cache[search] = old
|
||||||
return self._search_cache[search][1]
|
return self._search_cache[search][1]
|
||||||
|
|
||||||
|
|
||||||
def categories_cache(self, restrict_to=frozenset([])):
|
def categories_cache(self, restrict_to=frozenset([])):
|
||||||
base_restriction = self.search_cache('')
|
base_restriction = self.search_cache('')
|
||||||
if restrict_to:
|
if restrict_to:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user