projects
/
python-collate.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Cleanup in preparation for release. Add docstrings, remove basically empty _constants...
[python-collate.git]
/
collate
/
_locale.py
diff --git
a/collate/_locale.py
b/collate/_locale.py
index
70c085a
..
d20e184
100644
(file)
--- a/
collate/_locale.py
+++ b/
collate/_locale.py
@@
-1,5
+1,7
@@
"""Locale utility routines."""
"""Locale utility routines."""
+__all__ = ["localelist", "encoding", "getpair"]
+
import sys
try:
import sys
try:
@@
-12,8
+14,6
@@
try:
except ImportError:
codecs = None
except ImportError:
codecs = None
-__all__ = ["localelist"]
-
def localelist(*locales):
"""Normalize and return a list of locales, with appended defaults.
def localelist(*locales):
"""Normalize and return a list of locales, with appended defaults.
@@
-114,6
+114,7
@@
def encoding(preferred=None):
return locale.getpreferredencoding() or sys.getdefaultencoding()
def getpair(locale_, encoding_):
return locale.getpreferredencoding() or sys.getdefaultencoding()
def getpair(locale_, encoding_):
+ """If encoding_ is unspecified, get the locale encoding."""
if "." in locale_:
if encoding_ is None:
locale_, encoding_ = locale_.rsplit(".", 1)
if "." in locale_:
if encoding_ is None:
locale_, encoding_ = locale_.rsplit(".", 1)