summaryrefslogtreecommitdiff
path: root/src/mailman/bin
diff options
context:
space:
mode:
authorBarry Warsaw2009-05-15 18:57:40 -0400
committerBarry Warsaw2009-05-15 18:57:40 -0400
commitad07de3dcdbf0ef11b5b324b9521b748da207fc7 (patch)
tree98116b50d009464c247f490ca200939eaa3bc73f /src/mailman/bin
parent855d7188024f67570a946665f5ba19522fbdb48a (diff)
downloadmailman-ad07de3dcdbf0ef11b5b324b9521b748da207fc7.tar.gz
mailman-ad07de3dcdbf0ef11b5b324b9521b748da207fc7.tar.zst
mailman-ad07de3dcdbf0ef11b5b324b9521b748da207fc7.zip
rsplit -> rpartition
Diffstat (limited to 'src/mailman/bin')
-rw-r--r--src/mailman/bin/genaliases.py2
-rw-r--r--src/mailman/bin/master.py2
-rw-r--r--src/mailman/bin/qrunner.py10
3 files changed, 7 insertions, 7 deletions
diff --git a/src/mailman/bin/genaliases.py b/src/mailman/bin/genaliases.py
index e8916d030..fe587cb02 100644
--- a/src/mailman/bin/genaliases.py
+++ b/src/mailman/bin/genaliases.py
@@ -54,7 +54,7 @@ def main():
options.initialize()
# Get the MTA-specific module.
- module_path, class_path = config.mta.incoming.rsplit('.', 1)
+ package, dot, class_path = config.mta.incoming.rpartition('.')
__import__(module_path)
getattr(sys.modules[module_path], class_path)().regenerate()
diff --git a/src/mailman/bin/master.py b/src/mailman/bin/master.py
index d954bc865..1156f8a33 100644
--- a/src/mailman/bin/master.py
+++ b/src/mailman/bin/master.py
@@ -319,7 +319,7 @@ class Loop:
qrunner_config = getattr(config, section_name)
if not as_boolean(qrunner_config.start):
continue
- package, class_name = qrunner_config['class'].rsplit(DOT, 1)
+ package, dot, class_name = qrunner_config['class'].rpartition(DOT)
__import__(package)
# Let AttributeError propagate.
class_ = getattr(sys.modules[package], class_name)
diff --git a/src/mailman/bin/qrunner.py b/src/mailman/bin/qrunner.py
index 9c02a5c4d..99cb564bc 100644
--- a/src/mailman/bin/qrunner.py
+++ b/src/mailman/bin/qrunner.py
@@ -133,9 +133,9 @@ def make_qrunner(name, slice, range, once=False):
class_path = 'mailman.queue' + name
else:
class_path = name
- module_name, class_name = class_path.rsplit('.', 1)
+ package, dot, class_name = class_path.rpartition('.')
try:
- __import__(module_name)
+ __import__(package)
except ImportError, e:
if config.options.options.subproc:
# Exit with SIGTERM exit code so the master watcher won't try to
@@ -145,7 +145,7 @@ def make_qrunner(name, slice, range, once=False):
sys.exit(signal.SIGTERM)
else:
raise
- qrclass = getattr(sys.modules[module_name], class_name)
+ qrclass = getattr(sys.modules[package], class_name)
if once:
# Subclass to hack in the setting of the stop flag in _do_periodic()
class Once(qrclass):
@@ -204,8 +204,8 @@ def main():
if options.options.list:
descriptions = {}
for section in config.qrunner_configs:
- shortname = section.name.rsplit('.', 1)[-1]
- classname = getattr(section, 'class').rsplit('.', 1)[-1]
+ ignore, dot, shortname = section.name.rpartition('.')
+ ignore, dot, classname = getattr(section, 'class').rpartition('.')
descriptions[shortname] = classname
longest = max(len(name) for name in descriptions)
for shortname in sorted(descriptions):