summaryrefslogtreecommitdiff
path: root/Mailman/interfaces/languages.py
diff options
context:
space:
mode:
authorBarry Warsaw2007-07-18 11:46:44 -0400
committerBarry Warsaw2007-07-18 11:46:44 -0400
commit50d84950d1060129da8eb3c3c490a7395b0837e5 (patch)
tree0902bb4b1a5c8f7caa05191e9de9d3d0f76fe648 /Mailman/interfaces/languages.py
parent012fcb71e7e634b985219a7d5cf0deda87a2aa90 (diff)
downloadmailman-50d84950d1060129da8eb3c3c490a7395b0837e5.tar.gz
mailman-50d84950d1060129da8eb3c3c490a7395b0837e5.tar.zst
mailman-50d84950d1060129da8eb3c3c490a7395b0837e5.zip
More work on completing the transition to setuptools.
* Mailman/testing -> Mailman/test * Removed Mailman/testing/base.py * Fix mailmanctl by using a different way of calculating where the qrunner script is. The configuration file no longer knows what BIN_DIR is, but the mailmanctl script knows where it lives via sys.argv[0]. Also, PREFIX_DIR -> VAR_DIR. Also, * Since the overwhelmingly predominant use of ILanguageManager is to get the description, and since .get_language_data(code)[0] is not very readable, split the interface into .get_description() and .get_charset(). * In the setup, automatically add all Mailman.bin modules as command line scripts.
Diffstat (limited to 'Mailman/interfaces/languages.py')
-rw-r--r--Mailman/interfaces/languages.py18
1 files changed, 13 insertions, 5 deletions
diff --git a/Mailman/interfaces/languages.py b/Mailman/interfaces/languages.py
index 44a284a5b..b9ddd8c90 100644
--- a/Mailman/interfaces/languages.py
+++ b/Mailman/interfaces/languages.py
@@ -47,12 +47,20 @@ class ILanguageManager(Interface):
language code.
"""
- def get_language_data(code):
- """Return the description and charset for the given `code`.
+ def get_description(code):
+ """Return the language description for the given code.
- :param code: The code to lookup.
- :returns: A 2-tuple of the description and charset for the code.
- :raises KeyError: when the code is unknown.
+ :param code: The two letter language code to look up.
+ :returns: The English description of the language.
+ :raises KeyError: when the code has not been added.
+ """
+
+ def get_charset(code):
+ """Return the character set for the given code.
+
+ :param code: The two letter language code to look up.
+ :returns: The character set of the language.
+ :raises KeyError: when the code has not been added.
"""
known_codes = Attribute(