[Mailman-Developers] More on Mysql MemberAdaptor?

Kyrian (List) kyrian-list at ore.org
Wed Nov 5 06:11:40 EST 2003


On Wed, 5 Nov 2003 16:31:51 +0800
"Yuan, Cain" <cain.yuan at intel.com> wrote:

> Hi Kev,
> 	I had a look at the patch and have some questions here:  why you
> 	establish a connection to MySQL and then close it in each
> 	function?  AFAIK this will put much presure on MySQL if there
> 	are some people to subscribe/unscribe from the list.   Why not
> 	just establish a ststic link to MySQL and then use it every time
> 	you need to access the DB?
>
Seemed like a good idea at the time ;*)

But seriously, doing it that way means I don't really have to worry
about connection timeouts, etc. Maybe it can be rewritten later to work
differently (like when I learn to write better python ;*), but for the
most part, it will work now. I have cut down the number of connect()
calls a little already though, but not as far as perhaps I could go.

I've updated the whole thing a lot since both of those emails last
night.

The remaining problems, though, are that I still haven't cracked
{get,set}DeliveryStatus(for the reasons previously detailed),
and{get,set}BounceInfo, which is another problem.

In the MySQL database I end up with the following string:

<bounce info
for member bounceybouncey at orenet.co.uk
        current score: 1.0
        last bounce date: (2003, 11, 4)
        email notices left: 3
        last notice date: (1970, 1, 2)
        confirmation cookie: a9e8f042d93d3777da981f353f2e00ade42f6f 

I'm putting the "info" parameter from setBounceInfo directly into the
database, which I think is an array itself, not a single value, and the
above doesn't look like Python's just traversing an array, and dumping
it into the database(the LHS names don't tie up with what I think are
the keys for the subelements of "info"), so it looks like I'll have to
take a "best guess" at how to implement this.

If anyone has any useful suggestions, I'd appreciate them.

K.

> -----Original Message-----
> From: mailman-developers-bounces+cain.yuan=intel.com at python.org
> [mailto:mailman-developers-bounces+cain.yuan=intel.com at python.org]On
> Behalf Of Kyrian (List) Sent: Wednesday, November 05, 2003 2:04 AM
> To: mailman-developers at python.org
> Subject: [Mailman-Developers] More on Mysql MemberAdaptor?
> 
> 
> Further to my previous message, I've now got it reading config from
> mm_cfg.py, verifying the connectivity to the mysql database on the
> __init__ call, rather than throwing up(numerous) errors later on,
> updated the README to reflect relevant changes, and just generally
> cleaned things up a bit. That's RCS revision 1.13.
> 
> The only major problem I have is the return types for
> {get,set}DeliveryStatus. I can't work out how I'm suppose to return a
> tuple of values, and what they should be.
> 
> If someone could assist I'd be grateful :-)
> 
> K.
> 
> Begin forwarded message:
> 
> Date: Tue, 4 Nov 2003 15:27:45 +0000
> From: Kyrian (List) <kyrian-list at ore.org>
> To: mailman-developers at python.org
> Subject: Mysql MemberAdaptor?
> 
> 
> Hi All,
> 
> I'm presuming this is the appropriate list to post this to...
> 
> If anyone cares, I've written a Mysql MemberAdaptor based on the
> OldStyleMemberships.py module, which seems to work ok. I've not done
> much large scale testing as yet, though.
> 
> I've put it up at http://kyrian.ore.org/MailmanMysql/
> 
> Although I could use some pointers on the following:
> 
> - How to incorporate exception handling in python to trap DB errors,
> and stop Mailman choking on them.
> 
> - How to incorporate some better configuration (you currently would
> have to edit the module file directly to specify the database
> parameters)
> 
> - How to properly incorporate it into mailman (if nobody minds that
> ;), as it currently seems to require modifying MemberAdaptor.py
> directly to activate it.
> 
> - Whether I've actually done it even half way right?
> 
> Either way, if anyone has anything to say about it, please go easy, I
> kinda needed this thing, and delved into Python for the first time to
> do so.
> 
> Oh, and I know the MySQL data structure I'm using is pretty atrocious,
> as it was a best-guess, though I can always clean it up later...
> 
> I do hope I've not just spent several days reinventing the wheel here,
> though... ;*)
> 
> Yours,
> 
> Kev.
> 
> -- 
> Kev Green, aka Kyrian.       "Be excellent to each other" -- Bill &
> Ted.
>    Email: kyrian&#64;ore.org              Web: http://kyrian.ore.org/
>   ISP/Perl/PHP/Linux/Security Contractor, via
>   http://www.orenet.co.uk/--
> Kev Green, aka Kyrian.       "Be excellent to each other" -- Bill &
> Ted.
>    Email: kyrian&#64;ore.org              Web: http://kyrian.ore.org/
>   ISP/Perl/PHP/Linux/Security Contractor, via http://www.orenet.co.uk/
> 
> _______________________________________________
> Mailman-Developers mailing list
> Mailman-Developers at python.org
> http://mail.python.org/mailman/listinfo/mailman-developers


-- 
Kev Green, aka Kyrian. E: kyrian&#64;ore.org WWW: http://kyrian.ore.org/
  ISP/Perl/PHP/Linux/Security Contractor, via http://www.orenet.co.uk/
                "A superficial episode, as life continues to unfold"
                                       -- Bad Religion
-- 
Kev Green, aka Kyrian.       "Be excellent to each other" -- Bill & Ted.
   Email: kyrian&#64;ore.org              Web: http://kyrian.ore.org/
  ISP/Perl/PHP/Linux/Security Contractor, via http://www.orenet.co.uk/



More information about the Mailman-Developers mailing list