Re: [Mailman-Developers] [Mailman-checkins] [Branch ~mailman-coders/mailman/2.1]

-----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? - -Barry -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (Darwin) iD8DBQFHQIRK2YZpQepbvXERAjRQAJ9/yhfNVNoxMY+V3jS9p7rZka5QmQCgrNpS ZXyQ0KC915TCjkwM7ECdeOc= =M8JK -----END PGP SIGNATURE-----

-----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 SIGNATURE----- Version: GnuPG v1.4.7 (MingW32) iD8DBQFHQQU/VVuXXpU7hpMRAgKkAKDu+323UJuX81GEFrykXkh+SfxdNgCgx0Sy YtFAMJL5vdUfNV538VNl0uY= =aqO7 -----END PGP SIGNATURE-----

-----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, - -Barry -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (Darwin) iD8DBQFHQY6X2YZpQepbvXERAlNpAJ91ZKrl0gWY5r+l0OoPhwasBY0YHACgo/38 1QGhKpAIyf8gPgY0mCJIm6o= =z8gz -----END PGP SIGNATURE-----

-----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-10-05 02:50:56 +0000 +++ 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. - - from Mailman.Bouncer import _BounceInfo for m in mlist.bounce_info.keys(): if not mlist.isMember(m) or not isinstance(mlist.getBounceInfo(m), _BounceInfo): @@ -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 SIGNATURE----- Version: GnuPG v1.4.7 (MingW32) iD8DBQFHQcRxVVuXXpU7hpMRArZAAKD8R2Cif0NNC1X89rqyHn0hEjKibQCfRsSf wx9HFj66t+cnR7BtyE16s64= =C90I -----END PGP SIGNATURE-----

-----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.
- -Barry
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (Darwin)
iD8DBQFHR4zG2YZpQepbvXERAut0AJ40NPdqbfI3Z+EQsLibny4atEGjLQCgkw20 JLr8bvq5WFV/O45Uo7JoCX8= =FfSi -----END PGP SIGNATURE-----

-----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 SIGNATURE----- Version: GnuPG v1.4.7 (MingW32)
iD8DBQFHS0J5VVuXXpU7hpMRAk+7AJsG50NFD51ekFa+/BTyHubSSofVggCeLRCW 0+C7TwOptmT/3/znMVoY/XI= =Vd32 -----END PGP SIGNATURE-----

-----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!
- -Barry
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (Darwin)
iD8DBQFHS5gA2YZpQepbvXERAmpkAKCC0OLVQg2/0/SVUlNLmIcWiMh+QQCeJlQS Z82hlRrJp5s5z9QG9eyJ3yw= =Bray -----END PGP SIGNATURE-----
participants (3)
-
Barry Warsaw
-
Mark Sapiro
-
Mark Sapiro