RE: [squishdot] Mailing Content into Zope/Squishdot
In response to a couple of requests, here's the code that I use to post from our automation mailing list to the site http://beta.control.com/. Please feel free to visit the site, I've meant to announce it here for a while. It will go public (and change its url to www.control.com) sometime in March. The site will be down briefly later today while I upgrade it from Zope 2.0.x to 2.1.4. postToControlCom is an executable Python script that uses xmlrpc to talk to Squishdot. paths.py is a hack stolen from Mailman that lets postToControlCom use a bit of Mailman code. SquishExternals.py contains a Zope ExternalMethod that worries about trying to figure out where to add a reply in Squishdot. It's far from perfect; the current indexing scheme that Squishdot uses doesn't like some of the Subject lines that show up on the list fairly often (e.g. "words" that contain hyphens, letters and numbers mixed together such as "IEC1131-3"). Since the indexing stuff has changed with ZCatalog and there'll be a new Squishdot soon, we've just been living with the problems for now. Note, the use of __call__ in SquishExternals.py depends on a minor fix I made to Squishdot. Squishdot's standard __call___ method doesn't permit you to pass a dictionary instead of putting the search arguments in REQUEST. This caused problems for us because it was too easy for unwanted search keys to pollute REQUEST. To fix this, find the reference to REQUEST.set in the __call__ method and replace it with: try: REQUEST.set('summary',body) except AttributeError: # Assume we got a dictionary instead of a Request object REQUEST['summary'] = body Dan Pierson, Control.com, <dan@control.com>
participants (1)
-
Dan Pierson