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@ore.org> To: mailman-developers@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@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@ore.org Web: http://kyrian.ore.org/ ISP/Perl/PHP/Linux/Security Contractor, via http://www.orenet.co.uk/
On Tue, 2003-11-04 at 13:04, Kyrian wrote:
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.
Actually, these methods don't return tuples. In OldStyleMemberships.py, the underlying data structure records the change time and stores this as a tuple in the appropriate dictionary. You wouldn't need to do that. E.g. you could use a Timestamp column that gets automatically updated at any change. Then you'd just return this column for in the getDeliveryStatusChange() method.
-Barry
participants (2)
-
Barry Warsaw
-
Kyrian