Re: [Mailman-Developers] Interacting with mailman remotely through APIs / wrappers
Thanks again for your helpful reply. In particular, I really like the sound of being able to use different databases for different types/sources of data; this sort of ability to integrate is exactly the sort of thing I am envisioning.
Re: integrating PHP and Python:
I did, after various search combinations, find this presentation from 2002:
http://www.csh.rit.edu/~jon/pres/php-2002/pip-applications.ppt, and consequently http://www.csh.rit.edu/~jon/projects/pip/. However, nothing seems to have happened on this since 2002 and so I'm not really keen on it.
In any case, thinking about it more I realise that since I want to be able to use a standalone (and possibly remote) Mailman server a PHP/Python combination probably wouldn't be perfect.
One thing I did pickup from the presentation above was his use of the Python Mailman modules in his wrapper scripts. I've been looking more into what I can do using those, rather than the command line.
At the same time, I've been looking into what can be done (and how easily) using Web Services. In particular, I like the sound of the Zolera SOAP Infrastructure, which seems to provide a very simple way to access Python functions over SOAP. So, my thinking at the moment is to hack up a single Python object which wraps the relevant Mailman modules for the functionality I need to use, then use ZSI to expose that object as a web service. If I need to, I can always just call the command line scripts from that object, so I wouldn't be cutting off any options.
This seems to me, at the moment, to be the best compromise between doing it 'properly' and my need to have something up and running quickly, however ramshackle.
Benjamin
----- Original Message ---- From: Barry Warsaw <barry@python.org> To: Ben Sims <benjaminsims@yahoo.com> Cc: mailman-developers@python.org Sent: Saturday, 19 May, 2007 12:58:30 AM Subject: Re: [Mailman-Developers] Interacting with mailman remotely through APIs / wrappers
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On May 17, 2007, at 8:39 AM, Ben Sims wrote:
With regards to Mailman 3, from my reading I understand that this
will implement SQL-type storage for all configuration and list
data. This would completely take care of my needs in this case I
think; would you perhaps be able to give us a rough idea of progress?
Things are moving along well. My work these days has been to
complete the data model using Elixir and SQLAlchemy. I had a
breakthrough with Elixir a few days ago, so now I'm just working on
completing the model, related interfaces, and doctests. My plan is
to have a working database backend asap so I can unbreak all the
higher level stuff that depends on the data model. Right now I'm
working in a branch, but I am going to very soon merge this back to
the trunk, even though it will break the trunk. I speak more about
this in some later postings.
I'm trying to be very diligent about writing interfaces to describe
how Mailman interacts with the data model, so you could potentially
back it with different storage mechanisms. The idea is that you
might want to put your list data in Mailman's default SQLite
database, but you might want to get your user data out of your
enterprise database. By writing your own implementations of
Mailman's interfaces, you should be able to do that.
As a garden-variety PHP developer and Mailman rookie, I doubt how
far I am capable of going deep into Mailman itself to implement a
solution for this. I would be happy to do the research before
dismissing the idea though, if you could point me in the direction
of some bedtime reading on the subject. Given the time I have
available and the limited functionality required, I'm very much
leaning towards the cheapest hack option - which seems likely to be
simply executing command line commands.
I wonder if there isn't a cleaner way to integrate PHP and Python.
Does anybody know? Or is some form of IPC really the only way to go?
Writing command line interfaces to provide the functionality you want
should not be difficult at all, if you are comfortable writing Python.
Regarding your questions:
-- What functionality do you want to expose?
Not much. To start with, creating and removing lists and adding and
deleting subscribers would probably be enough.
Creating and removing lists are a bit hackish now because the logic
to do so is spread out in a couple of places. However see the bin/
newlist script or Mailman/Cgi/newlist.py module for examples. The
former may already do what you need here. This will get much easier
in MM3.
Likewise for adding and deleting subscribers.
-- How would you handle security?
To be honest, I hadn't even got as far as thinking about that,
since I'm not really clear on the mechanisms involved.
- Will you have to re-implement much of the CGI logic?
Again, I haven't gone through closely enough to give a decent
answer. If I was hacking something up which did use the Web
Interface as a gateway, I would be more likely to use Mechanize to
fake a browser and do the intereacting. Ugly I know, but I'm
familiar with that so I could get it to work.
Probably much easier to use the existing command line scripts,
augmenting or writing your own as needed. Remember you can also do a
lot with bin/withlist scripts.
Cheers,
- -Barry
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (Darwin)
iQCVAwUBRk4hh3EjvBPtnXfVAQIQ+AP9HupG3WJ9X8hD+vsowrLCq5FwWlw194P9 iB2qHhTbafFlURf/7dXt+JLfX7UjTchydsBPaNR00UwBUZcMohTXCbJJSEi+kMwg 7p32bknigvmC/3qujLzkZz08lwUo86mK6e7q/w55O6fb1DAXVfYiw+1LpBJagZ7h E/iTlLiJHOI= =yIkR -----END PGP SIGNATURE-----
___________________________________________________________
Yahoo! Mail is the world's favourite email. Don't settle for less, sign up for your free account today http://uk.rd.yahoo.com/evt=44106/*http://uk.docs.yahoo.com/mail/winter07.htm...
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On May 19, 2007, at 3:22 PM, Ben Sims wrote:
Thanks again for your helpful reply. In particular, I really like
the sound of being able to use different databases for different
types/sources of data; this sort of ability to integrate is exactly
the sort of thing I am envisioning.Re: integrating PHP and Python:
I did, after various search combinations, find this presentation
from 2002:http://www.csh.rit.edu/~jon/pres/php-2002/pip-applications.ppt, and
consequently http://www.csh.rit.edu/~jon/projects/pip/. However,
nothing seems to have happened on this since 2002 and so I'm not
really keen on it.In any case, thinking about it more I realise that since I want to
be able to use a standalone (and possibly remote) Mailman server a
PHP/Python combination probably wouldn't be perfect.One thing I did pickup from the presentation above was his use of
the Python Mailman modules in his wrapper scripts. I've been
looking more into what I can do using those, rather than the
command line.At the same time, I've been looking into what can be done (and how
easily) using Web Services. In particular, I like the sound of the
Zolera SOAP Infrastructure, which seems to provide a very simple
way to access Python functions over SOAP. So, my thinking at the
moment is to hack up a single Python object which wraps the
relevant Mailman modules for the functionality I need to use, then
use ZSI to expose that object as a web service. If I need to, I can
always just call the command line scripts from that object, so I
wouldn't be cutting off any options.This seems to me, at the moment, to be the best compromise between
doing it 'properly' and my need to have something up and running
quickly, however ramshackle.
Hi Ben, please let us know how it goes.
Cheers,
- -Barry
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (Darwin)
iQCVAwUBRlIIe3EjvBPtnXfVAQKk8QP9Fr84KeCRdiuTX2bdvWHcGJN9TL99qSpj FrWCdEUYjOpihUdaI414eHH5+cs2dlgWP/sHtjA1fxl7sNXrnQo5wiRgXSY12nq3 dX7lGP93kxeix+ukeb+JLKlOlrrUC7Jq39XV/w4vwB5w4j8PtqWET91rYj0qu99Z k3IQ/Ki2hW0= =sfGx -----END PGP SIGNATURE-----
participants (2)
-
Barry Warsaw
-
Ben Sims