mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 10:44:09 -04:00
...
This commit is contained in:
commit
b12e0123aa
@ -13,7 +13,7 @@ from calibre.devices.interface import BookList as _BookList
|
||||
from calibre.constants import preferred_encoding
|
||||
from calibre import isbytestring
|
||||
from calibre.utils.config import prefs, tweaks
|
||||
from calibre.utils.icu import sort_key
|
||||
from calibre.utils.icu import sort_key, strcmp as icu_strcmp
|
||||
|
||||
class Book(Metadata):
|
||||
def __init__(self, prefix, lpath, size=None, other=None):
|
||||
@ -241,7 +241,7 @@ class CollectionsBookList(BookList):
|
||||
if y is None:
|
||||
return -1
|
||||
if isinstance(x, (unicode, str)):
|
||||
c = cmp(sort_key(x), sort_key(y))
|
||||
c = strcmp(x, y)
|
||||
else:
|
||||
c = cmp(x, y)
|
||||
if c != 0:
|
||||
|
@ -18,7 +18,7 @@ from calibre.ebooks.metadata import fmt_sidx, authors_to_string, string_to_autho
|
||||
from calibre.ptempfile import PersistentTemporaryFile
|
||||
from calibre.utils.config import tweaks, prefs
|
||||
from calibre.utils.date import dt_factory, qt_to_dt, isoformat
|
||||
from calibre.utils.icu import sort_key
|
||||
from calibre.utils.icu import sort_key, strcmp as icu_strcmp
|
||||
from calibre.ebooks.metadata.meta import set_metadata as _set_metadata
|
||||
from calibre.utils.search_query_parser import SearchQueryParser
|
||||
from calibre.library.caches import _match, CONTAINS_MATCH, EQUALS_MATCH, \
|
||||
@ -1023,8 +1023,8 @@ class DeviceBooksModel(BooksModel): # {{{
|
||||
x = ''
|
||||
if y == None:
|
||||
y = ''
|
||||
x, y = x.strip().lower(), y.strip().lower()
|
||||
return cmp(x, y)
|
||||
x, y = icu_lower(x.strip()), icu_lower(y.strip())
|
||||
return icu_strcmp(x, y)
|
||||
return _strcmp
|
||||
def datecmp(x, y):
|
||||
x = self.db[x].datetime
|
||||
|
Loading…
x
Reference in New Issue
Block a user