def make_collation_func(name, locale, numeric=True, template='_sort_key_template', func='strcmp'): c = icu._icu.Collator(locale) cname = '%s_test_collator%s' % (name, template) setattr(icu, cname, c) c.numeric = numeric yield icu._make_func(getattr(icu, template), name, collator=cname, collator_func='not_used_xxx', func=func) delattr(icu, cname)
def make_collation_func(name, locale, numeric=True, template="_sort_key_template", func="strcmp"): c = icu._icu.Collator(locale) cname = "%s_test_collator%s" % (name, template) setattr(icu, cname, c) c.numeric = numeric yield icu._make_func(getattr(icu, template), name, collator=cname, collator_func="not_used_xxx", func=func) delattr(icu, cname)