mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-01-06 04:14:58 +01:00
...
This commit is contained in:
parent
bfb434fb30
commit
655d67a94d
1 changed files with 2 additions and 16 deletions
|
|
@ -674,7 +674,7 @@ def update_path(self, book_ids, mark_as_dirtied=True):
|
|||
|
||||
# }}}
|
||||
|
||||
class SortKey(object):
|
||||
class SortKey(object): # {{{
|
||||
|
||||
def __init__(self, fields, sort_keys, book_id):
|
||||
self.orders = tuple(1 if f[1] else -1 for f in fields)
|
||||
|
|
@ -686,19 +686,5 @@ def __cmp__(self, other):
|
|||
if ans != 0:
|
||||
return ans * order
|
||||
return 0
|
||||
|
||||
|
||||
# Testing {{{
|
||||
|
||||
def test(library_path):
|
||||
from calibre.db.backend import DB
|
||||
backend = DB(library_path)
|
||||
cache = Cache(backend)
|
||||
cache.init()
|
||||
print ('All book ids:', cache.all_book_ids())
|
||||
|
||||
if __name__ == '__main__':
|
||||
from calibre.utils.config import prefs
|
||||
test(prefs['library_path'])
|
||||
|
||||
# }}}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue