diff --git a/src/calibre/db/categories.py b/src/calibre/db/categories.py index b9de1316f9..552ec68523 100644 --- a/src/calibre/db/categories.py +++ b/src/calibre/db/categories.py @@ -116,8 +116,9 @@ def clean_user_categories(dbcache): numeric_collation = tweaks['numeric_collation'] + + def first_digit(x): - global numeric_collation c = icu_upper(x.sort or x.name or ' ')[0] # The idea is that '9999999999' is larger than any digit so all digits # will sort in front. Non-digits will sort according to their ICU first letter diff --git a/src/calibre/utils/icu_test.py b/src/calibre/utils/icu_test.py index d40a720b91..ec407537d8 100644 --- a/src/calibre/utils/icu_test.py +++ b/src/calibre/utils/icu_test.py @@ -116,7 +116,6 @@ class TestICU(unittest.TestCase): def test_collation_order(self): 'Testing collation ordering' - from calibre.utils.icu import collation_order for group in [ (self.ae, ('Šaa', 'Smith', 'Solženicyn', 'Štepánek')), (self.ae, ('11', '011')),