------------------------------------------------------------
revno: 6731
committer: Barry Warsaw <[email protected]>
branch nick: 3.0
timestamp: Fri 2009-05-15 18:57:40 -0400
message:
rsplit -> rpartition
modified:
src/mailman/app/lifecycle.py
src/mailman/bin/genaliases.py
src/mailman/bin/master.py
src/mailman/bin/qrunner.py
src/mailman/config/config.py
src/mailman/database/pending.py
src/mailman/database/types.py
src/mailman/pipeline/scrubber.py
src/mailman/queue/outgoing.py
src/mailman/styles/manager.py
=== modified file 'src/mailman/app/lifecycle.py'
--- src/mailman/app/lifecycle.py 2009-02-13 03:52:18 +0000
+++ src/mailman/app/lifecycle.py 2009-05-15 22:57:40 +0000
@@ -54,9 +54,9 @@
for style in config.style_manager.lookup(mlist):
style.apply(mlist)
# Coordinate with the MTA, as defined in the configuration file.
- module_name, class_name = config.mta.incoming.rsplit('.', 1)
- __import__(module_name)
- getattr(sys.modules[module_name], class_name)().create(mlist)
+ package, dot, class_name = config.mta.incoming.rpartition('.')
+ __import__(package)
+ getattr(sys.modules[package], class_name)().create(mlist)
# Create any owners that don't yet exist, and subscribe all addresses as
# owners of the mailing list.
usermgr = config.db.user_manager
@@ -83,9 +83,9 @@
# Delete the mailing list from the database.
config.db.list_manager.delete(mailing_list)
# Do the MTA-specific list deletion tasks
- module_name, class_name = config.mta.incoming.rsplit('.', 1)
- __import__(module_name)
- getattr(sys.modules[module_name], class_name)().create(mailing_list)
+ package, dot, class_name = config.mta.incoming.rpartition('.')
+ __import__(package)
+ getattr(sys.modules[package], class_name)().create(mailing_list)
# Remove the list directory.
removeables.append(os.path.join(config.LIST_DATA_DIR, fqdn_listname))
# Remove any stale locks associated with the list.
=== modified file 'src/mailman/bin/genaliases.py'
--- src/mailman/bin/genaliases.py 2009-01-07 04:45:34 +0000
+++ src/mailman/bin/genaliases.py 2009-05-15 22:57:40 +0000
@@ -54,7 +54,7 @@
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()
=== modified file 'src/mailman/bin/master.py'
--- src/mailman/bin/master.py 2009-01-05 05:54:19 +0000
+++ src/mailman/bin/master.py 2009-05-15 22:57:40 +0000
@@ -319,7 +319,7 @@
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)
=== modified file 'src/mailman/bin/qrunner.py'
--- src/mailman/bin/qrunner.py 2009-05-12 02:08:07 +0000
+++ src/mailman/bin/qrunner.py 2009-05-15 22:57:40 +0000
@@ -133,9 +133,9 @@
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 @@
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 @@
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):
=== modified file 'src/mailman/config/config.py'
--- src/mailman/config/config.py 2009-05-15 22:37:29 +0000
+++ src/mailman/config/config.py 2009-05-15 22:57:40 +0000
@@ -191,9 +191,9 @@
if not as_boolean(section.enable):
continue
class_path = section['class']
- module_name, class_name = class_path.rsplit('.', 1)
- __import__(module_name)
- yield getattr(sys.modules[module_name], class_name)()
+ package, dot, class_name = class_path.rpartition('.')
+ __import__(package)
+ yield getattr(sys.modules[package], class_name)()
@property
def style_configs(self):
=== modified file 'src/mailman/database/pending.py'
--- src/mailman/database/pending.py 2009-01-17 02:16:43 +0000
+++ src/mailman/database/pending.py 2009-05-15 22:57:40 +0000
@@ -146,7 +146,7 @@
PendedKeyValue.pended_id == pending.id):
if keyvalue.value is not None and '\1' in keyvalue.value:
typename, value = keyvalue.value.split('\1', 1)
- package, classname = typename.rsplit('.', 1)
+ package, dot, classname = typename.rpartition('.')
__import__(package)
module = sys.modules[package]
pendable[keyvalue.key] = getattr(module, classname)(value)
=== modified file 'src/mailman/database/types.py'
--- src/mailman/database/types.py 2009-01-17 02:04:21 +0000
+++ src/mailman/database/types.py 2009-05-15 22:57:40 +0000
@@ -41,10 +41,10 @@
return None
if not from_db:
return value
- path, intvalue = value.rsplit(':', 1)
- modulename, classname = path.rsplit('.', 1)
- __import__(modulename)
- cls = getattr(sys.modules[modulename], classname)
+ path, colon, intvalue = value.rpartition(':')
+ package, dot, classname = path.rpartition('.')
+ __import__(package)
+ cls = getattr(sys.modules[package], classname)
return cls[int(intvalue)]
def parse_get(self, value, to_db):
=== modified file 'src/mailman/pipeline/scrubber.py'
--- src/mailman/pipeline/scrubber.py 2009-03-10 04:06:16 +0000
+++ src/mailman/pipeline/scrubber.py 2009-05-15 22:57:40 +0000
@@ -487,9 +487,9 @@
fp.close()
# Now calculate the url to the list's archive.
scrubber_path = config.scrubber.archive_scrubber
- package_name, module_name = scrubber_path.rsplit('.', 1)
- __import__(package_name)
- baseurl = getattr(sys.modules[package_name], module_name).list_url(mlist)
+ package, dot, module_name = scrubber_path.rpartition('.')
+ __import__(package)
+ baseurl = getattr(sys.modules[package], module_name).list_url(mlist)
if not baseurl.endswith('/'):
baseurl += '/'
# Trailing space will definitely be a problem with format=flowed.
=== modified file 'src/mailman/queue/outgoing.py'
--- src/mailman/queue/outgoing.py 2009-01-07 00:55:59 +0000
+++ src/mailman/queue/outgoing.py 2009-05-15 22:57:40 +0000
@@ -45,9 +45,9 @@
Runner.__init__(self, slice, numslices)
BounceMixin.__init__(self)
# We look this function up only at startup time.
- module_name, callable_name = config.mta.outgoing.rsplit('.', 1)
- __import__(module_name)
- self._func = getattr(sys.modules[module_name], callable_name)
+ package, dot, callable_name = config.mta.outgoing.rpartition('.')
+ __import__(package)
+ self._func = getattr(sys.modules[package], callable_name)
# This prevents smtp server connection problems from filling up the
# error log. It gets reset if the message was successfully sent, and
# set if there was a socket.error.
=== modified file 'src/mailman/styles/manager.py'
--- src/mailman/styles/manager.py 2009-01-17 02:04:21 +0000
+++ src/mailman/styles/manager.py 2009-05-15 22:57:40 +0000
@@ -52,9 +52,9 @@
# Install all the styles described by the configuration files.
for section in config.style_configs:
class_path = section['class']
- module_name, class_name = class_path.rsplit('.', 1)
- __import__(module_name)
- style = getattr(sys.modules[module_name], class_name)()
+ package, dot, class_name = class_path.rpartition('.')
+ __import__(package)
+ style = getattr(sys.modules[package], class_name)()
assert section.name.startswith('style'), (
'Bad style section name: %s' % section.name)
style.name = section.name[6:]
--
Primary development focus
https://code.launchpad.net/~mailman-coders/mailman/3.0
Your team Mailman Checkins is subscribed to branch lp:mailman.
To unsubscribe from this branch go to
https://code.launchpad.net/~mailman-coders/mailman/3.0/+edit-subscription.
_______________________________________________
Mailman-checkins mailing list
[email protected]
Unsubscribe:
http://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org