-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Oct 4, 2007, at 9:46 PM, noreply@launchpad.net wrote:
revno: 992 committer: Mark Sapiro msapiro@value.net branch nick: 2.1 timestamp: Thu 2007-10-04 18:35:10 -0700 message: /cygdrive/c/MM_bzr/log.txt modified: Mailman/versions.py
=== modified file 'Mailman/versions.py' --- a/Mailman/versions.py 2005-12-30 18:50:08 +0000 +++ b/Mailman/versions.py 2007-10-05 01:35:10 +0000 @@ -483,10 +483,11 @@ # blow away the original timestamp and request id.
This means the # request will live a little longer than it possibly
should have, # but that's no big deal.
import email for p in v: author, text = p[2] reason = p[3]
msg = Message.OutgoingMessage(text)
msg = email.message_from_string(text,
Message.Message) l.HoldMessage(msg, reason) del r[k] elif k == 'add_member':
Should the import happen at the module global level?
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Barry Warsaw wrote:
On Oct 4, 2007, at 9:46 PM, noreply@launchpad.net wrote:
revno: 992 committer: Mark Sapiro msapiro@value.net branch nick: 2.1 timestamp: Thu 2007-10-04 18:35:10 -0700 message: /cygdrive/c/MM_bzr/log.txt modified: Mailman/versions.py
=== modified file 'Mailman/versions.py' --- a/Mailman/versions.py 2005-12-30 18:50:08 +0000 +++ b/Mailman/versions.py 2007-10-05 01:35:10 +0000 @@ -483,10 +483,11 @@ # blow away the original timestamp and request id.
This means the # request will live a little longer than it possibly
should have, # but that's no big deal.
import email for p in v: author, text = p[2] reason = p[3]
msg = Message.OutgoingMessage(text)
msg = email.message_from_string(text,
Message.Message) l.HoldMessage(msg, reason) del r[k] elif k == 'add_member':
Should the import happen at the module global level?
I thought about that. Our standards of course say yes, but this particular import only occurs when updating a Mailman 1.0.x list which I hope happens very infrequently. However I don't really feel strongly either way.
Mark Sapiro msapiro@value.net The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Nov 18, 2007, at 10:38 PM, Mark Sapiro wrote:
=== modified file 'Mailman/versions.py' --- a/Mailman/versions.py 2005-12-30 18:50:08 +0000 +++ b/Mailman/versions.py 2007-10-05 01:35:10 +0000 @@ -483,10 +483,11 @@ # blow away the original timestamp and request id. This means the # request will live a little longer than it possibly should have, # but that's no big deal.
import email for p in v: author, text = p[2] reason = p[3]
msg = Message.OutgoingMessage(text)
msg = email.message_from_string(text,
Message.Message) l.HoldMessage(msg, reason) del r[k] elif k == 'add_member':
Should the import happen at the module global level?
I thought about that. Our standards of course say yes, but this particular import only occurs when updating a Mailman 1.0.x list
which I hope happens very infrequently. However I don't really feel strongly either way.
Ultimately it's a style issue. I'm nearly positive that it will make
no significant different in performance. Generally I like to have
function scope imports only when necessary (e.g. to avoid circular
import problems). But I'll leave it up to you to change or not.
Cheers,
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Barry Warsaw wrote:
On Nov 18, 2007, at 10:38 PM, Mark Sapiro wrote:
I thought about that. Our standards of course say yes, but this particular import only occurs when updating a Mailman 1.0.x list which I hope happens very infrequently. However I don't really feel strongly either way.
Ultimately it's a style issue. I'm nearly positive that it will make no significant different in performance. Generally I like to have function scope imports only when necessary (e.g. to avoid circular import problems). But I'll leave it up to you to change or not.
I've moved the email import, and also an import of _BounceInfo. I'm ready to commit this, but I want to run it by you first to see if I'm missing anything with regard to moving the import of _BounceInfo.
=== modified file 'Mailman/versions.py'
+++ Mailman/versions.py 2007-11-19 17:02:10 +0000 @@ -33,11 +33,14 @@ """
+import email
from types import ListType, StringType
from Mailman import mm_cfg from Mailman import Utils from Mailman import Message +from Mailman.Bouncer import _BounceInfo from Mailman.MemberAdaptor import UNKNOWN from Mailman.Logging.Syslog import syslog
@@ -419,7 +422,6 @@ # Go through all the keys in bounce_info. If the key is not a member, or # if the data is not a _BounceInfo instance, chuck the bounce info. We're # doing things differently now.
@@ -483,7 +485,6 @@ # blow away the original timestamp and request id. This means the # request will live a little longer than it possibly should have, # but that's no big deal.
import email
for p in v:
author, text = p[2]
reason = p[3]
Mark Sapiro msapiro@value.net The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Nov 19, 2007, at 12:14 PM, Mark Sapiro wrote:
Barry Warsaw wrote:
On Nov 18, 2007, at 10:38 PM, Mark Sapiro wrote:
I thought about that. Our standards of course say yes, but this particular import only occurs when updating a Mailman 1.0.x list
which I hope happens very infrequently. However I don't really feel strongly either way.Ultimately it's a style issue. I'm nearly positive that it will
make no significant different in performance. Generally I like to have
function scope imports only when necessary (e.g. to avoid circular import problems). But I'll leave it up to you to change or not.I've moved the email import, and also an import of _BounceInfo. I'm ready to commit this, but I want to run it by you first to see if I'm missing anything with regard to moving the import of _BounceInfo.
Hi Mark,
I think it should be fine, as long as it doesn't create a circular
import. I didn't run the code, but from grepping it looks like we
should be okay. The only import of Mailman.versions is at file scope
afaict.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Barry Warsaw wrote:
On Nov 19, 2007, at 12:14 PM, Mark Sapiro wrote:
I've moved the email import, and also an import of _BounceInfo. I'm ready to commit this, but I want to run it by you first to see if I'm missing anything with regard to moving the import of _BounceInfo.
Hi Mark,
I think it should be fine, as long as it doesn't create a circular import. I didn't run the code, but from grepping it looks like we should be okay. The only import of Mailman.versions is at file scope afaict.
I have now actually tested the code thanks to Tokio's sibling list patch, and it works without problems (and the move of the imports has been committed).
Mark Sapiro mark@msapiro.net The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Nov 26, 2007, at 5:02 PM, Mark Sapiro wrote:
I have now actually tested the code thanks to Tokio's sibling list patch, and it works without problems (and the move of the imports has been committed).
Awesome, thanks!