mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
e021f02e35
commit
8716c5611f
@ -5,6 +5,7 @@ __license__ = 'GPL v3'
|
|||||||
__copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>'
|
__copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>'
|
||||||
__docformat__ = 'restructuredtext en'
|
__docformat__ = 'restructuredtext en'
|
||||||
|
|
||||||
|
# Setup code {{{
|
||||||
from functools import partial
|
from functools import partial
|
||||||
|
|
||||||
from calibre.constants import plugins
|
from calibre.constants import plugins
|
||||||
@ -77,8 +78,10 @@ load_icu()
|
|||||||
load_collator()
|
load_collator()
|
||||||
_icu_not_ok = _icu is None or _collator is None
|
_icu_not_ok = _icu is None or _collator is None
|
||||||
|
|
||||||
|
# }}}
|
||||||
|
|
||||||
################# The string functions ########################################
|
################# The string functions ########################################
|
||||||
|
|
||||||
sort_key = py_sort_key if _icu_not_ok else partial(icu_sort_key, _collator)
|
sort_key = py_sort_key if _icu_not_ok else partial(icu_sort_key, _collator)
|
||||||
|
|
||||||
strcmp = py_strcmp if _icu_not_ok else partial(icu_strcmp, _collator)
|
strcmp = py_strcmp if _icu_not_ok else partial(icu_strcmp, _collator)
|
||||||
@ -96,6 +99,7 @@ lower = (lambda s: s.lower()) if _icu_not_ok else \
|
|||||||
|
|
||||||
title_case = (lambda s: s.title()) if _icu_not_ok else \
|
title_case = (lambda s: s.title()) if _icu_not_ok else \
|
||||||
partial(_icu.title, get_locale())
|
partial(_icu.title, get_locale())
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
def test(): # {{{
|
def test(): # {{{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user