Former-commit-id:133dc97f67
[formerlya02aeb236c
] [formerly9f19e3f712
] [formerly06a8b51d6d
[formerly9f19e3f712
[formerly 64fa9254b946eae7e61bbc3f513b7c3696c4f54f]]] Former-commit-id:06a8b51d6d
Former-commit-id:377dcd10b9
[formerly3360eb6c5f
] Former-commit-id:8e80217e59
19 lines
410 B
Python
Executable file
19 lines
410 B
Python
Executable file
# -*- coding: utf-8 -*-
|
|
"""
|
|
cupoftee.utils
|
|
~~~~~~~~~~~~~~
|
|
|
|
Various utilities.
|
|
|
|
:copyright: (c) 2009 by the Werkzeug Team, see AUTHORS for more details.
|
|
:license: BSD, see LICENSE for more details.
|
|
"""
|
|
import re
|
|
|
|
|
|
_sort_re = re.compile(r'\w+(?u)')
|
|
|
|
|
|
def unicodecmp(a, b):
|
|
x, y = map(_sort_re.search, [a, b])
|
|
return cmp((x and x.group() or a).lower(), (y and y.group() or b).lower())
|