From 8938d65327611dded72c7876ffe52e4d4d12ce76 Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Thu, 10 Dec 2009 22:32:25 -0500 Subject: * 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. --- src/mailman/commands/cli_lists.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/mailman/commands/cli_lists.py') diff --git a/src/mailman/commands/cli_lists.py b/src/mailman/commands/cli_lists.py index d3833c2b0..93749c45a 100644 --- a/src/mailman/commands/cli_lists.py +++ b/src/mailman/commands/cli_lists.py @@ -40,6 +40,7 @@ from mailman.email.message import UserNotification from mailman.interfaces.command import ICLISubCommand from mailman.interfaces.domain import ( BadDomainSpecificationError, IDomainManager) +from mailman.interfaces.languages import ILanguageManager from mailman.interfaces.listmanager import IListManager, ListAlreadyExistsError @@ -174,7 +175,7 @@ class Create: if args.language is not None else system_preferences.preferred_language.code) # Make sure that the selected language code is known. - if language_code not in config.languages.codes: + if language_code not in getUtility(ILanguageManager).codes: self.parser.error(_('Invalid language code: $language_code')) return assert len(args.listname) == 1, ( @@ -199,7 +200,7 @@ class Create: # Find the language associated with the code, then set the mailing # list's preferred language to that. The changes then must be # committed to the database. - mlist.preferred_language = config.languages[language_code] + mlist.preferred_language = getUtility(ILanguageManager)[language_code] config.db.commit() # Do the notification. if not args.quiet: -- cgit v1.2.3-70-g09d2