mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Allow capsule based access to the ICU collator
This commit is contained in:
parent
5816c4aaeb
commit
37ac52ad32
@ -131,6 +131,12 @@ icu_Collator_actual_locale(icu_Collator *self, void *closure) {
|
||||
|
||||
// }}}
|
||||
|
||||
// Collator.capsule {{{
|
||||
static PyObject *
|
||||
icu_Collator_capsule(icu_Collator *self, void *closure) {
|
||||
return PyCapsule_New(self->collator, NULL, NULL);
|
||||
} // }}}
|
||||
|
||||
// Collator.sort_key {{{
|
||||
static PyObject *
|
||||
icu_Collator_sort_key(icu_Collator *self, PyObject *args, PyObject *kwargs) {
|
||||
@ -411,6 +417,11 @@ static PyGetSetDef icu_Collator_getsetters[] = {
|
||||
(char *)"Actual locale used by this collator.",
|
||||
NULL},
|
||||
|
||||
{(char *)"capsule",
|
||||
(getter)icu_Collator_capsule, NULL,
|
||||
(char *)"A capsule enclosing the pointer to the ICU collator struct",
|
||||
NULL},
|
||||
|
||||
{(char *)"display_name",
|
||||
(getter)icu_Collator_display_name, NULL,
|
||||
(char *)"Display name of this collator in English. The name reflects the actual data source used.",
|
||||
|
Loading…
x
Reference in New Issue
Block a user