diff options
| author | Barry Warsaw | 2009-05-16 11:08:46 -0400 |
|---|---|---|
| committer | Barry Warsaw | 2009-05-16 11:08:46 -0400 |
| commit | 7e23b2f358806cb14b92dc7833ce773738534d41 (patch) | |
| tree | 5499b536a163ebb4dedab62f4f7a97b460cece18 /src/mailman/core/initialize.py | |
| parent | ad07de3dcdbf0ef11b5b324b9521b748da207fc7 (diff) | |
| download | mailman-7e23b2f358806cb14b92dc7833ce773738534d41.tar.gz mailman-7e23b2f358806cb14b92dc7833ce773738534d41.tar.zst mailman-7e23b2f358806cb14b92dc7833ce773738534d41.zip | |
Diffstat (limited to 'src/mailman/core/initialize.py')
| -rw-r--r-- | src/mailman/core/initialize.py | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/mailman/core/initialize.py b/src/mailman/core/initialize.py index 18cb823ee..885174fb0 100644 --- a/src/mailman/core/initialize.py +++ b/src/mailman/core/initialize.py @@ -45,6 +45,7 @@ import mailman.config.config import mailman.core.logging from mailman.interfaces.database import IDatabase +from mailman.utilities.modules import call_name @@ -92,15 +93,11 @@ def initialize_2(debug=False): # Run the pre-hook if there is one. config = mailman.config.config if config.mailman.pre_hook: - package, dot, function = config.mailman.pre_hook.rpartition('.') - __import__(package) - getattr(sys.modules[package], function)() + call_name(config.mailman.pre_hook) # Instantiate the database class, ensure that it's of the right type, and # initialize it. Then stash the object on our configuration object. database_class = config.database['class'] - package, dot, class_name = database_class.rpartition('.') - __import__(package) - database = getattr(sys.modules[package], class_name)() + database = call_name(database_class) verifyObject(IDatabase, database) database.initialize(debug) config.db = database @@ -132,9 +129,7 @@ def initialize_3(): # Run the post-hook if there is one. config = mailman.config.config if config.mailman.post_hook: - package, dot, function = config.mailman.post_hook.rpartition('.') - __import__(package) - getattr(sys.modules[package], function)() + call_name(config.mailman.post_hook) |
