diff options
| author | Barry Warsaw | 2009-12-10 22:32:25 -0500 |
|---|---|---|
| committer | Barry Warsaw | 2009-12-10 22:32:25 -0500 |
| commit | 8938d65327611dded72c7876ffe52e4d4d12ce76 (patch) | |
| tree | 7e2d5c354dd53f1d3f8c42b4a11a9b58b2c2fcb1 /src/mailman/core | |
| parent | fbc81f61609ce0504245934d9bed0690fbd331a7 (diff) | |
| download | mailman-8938d65327611dded72c7876ffe52e4d4d12ce76.tar.gz mailman-8938d65327611dded72c7876ffe52e4d4d12ce76.tar.zst mailman-8938d65327611dded72c7876ffe52e4d4d12ce76.zip | |
* Refactor the language manager off of the config object and into a utility.
* Fix a few small typos in exception handlers.
* Move the initialization of the Zope Component Architecture into the first
initialization step. The only reason we couldn't do that previously was
because the domain object referenced the config, causing a circularity
problem. Refactor the Domain implementation to avoid that.
Diffstat (limited to 'src/mailman/core')
| -rw-r--r-- | src/mailman/core/constants.py | 4 | ||||
| -rw-r--r-- | src/mailman/core/initialize.py | 6 |
2 files changed, 6 insertions, 4 deletions
diff --git a/src/mailman/core/constants.py b/src/mailman/core/constants.py index 1701c93f7..5eac8f0d6 100644 --- a/src/mailman/core/constants.py +++ b/src/mailman/core/constants.py @@ -25,9 +25,11 @@ __all__ = [ ] +from zope.component import getUtility from zope.interface import implements from mailman.config import config +from mailman.interfaces.languages import ILanguageManager from mailman.interfaces.member import DeliveryMode, DeliveryStatus from mailman.interfaces.preferences import IPreferences @@ -52,7 +54,7 @@ class SystemDefaultPreferences: @property def preferred_language(self): """Return the system preferred language.""" - return config.languages['en'] + return getUtility(ILanguageManager)[config.mailman.default_language] diff --git a/src/mailman/core/initialize.py b/src/mailman/core/initialize.py index 707bb3f66..5da2209fd 100644 --- a/src/mailman/core/initialize.py +++ b/src/mailman/core/initialize.py @@ -58,6 +58,7 @@ from mailman.utilities.modules import call_name def initialize_1(config_path=None, propagate_logs=None): """First initialization step. + * Zope component architecture * The configuration system * Run-time directories * The logging subsystem @@ -68,6 +69,8 @@ def initialize_1(config_path=None, propagate_logs=None): :param propagate_logs: Should the log output propagate to stderr? :type propagate_logs: boolean or None """ + zcml = resource_string('mailman.config', 'configure.zcml') + xmlconfig.string(zcml) # By default, set the umask so that only owner and group can read and # write our files. Specifically we must have g+rw and we probably want # o-rwx although I think in most cases it doesn't hurt if other can read @@ -120,11 +123,8 @@ def initialize_2(debug=False): def initialize_3(): """Third initialization step. - * Zope component architecture * Post-hook """ - zcml = resource_string('mailman.config', 'configure.zcml') - xmlconfig.string(zcml) # Run the post-hook if there is one. config = mailman.config.config if config.mailman.post_hook: |
