[Zope] FTP Support for PythonMethods

Michel Pelletier michel@digicool.com
Mon, 13 Sep 1999 11:01:31 -0400


> -----Original Message-----
> From: chas [mailto:panda@skinnyhippo.com]
> Sent: Sunday, September 12, 1999 3:27 PM
> To: zope@zope.org
> Subject: [Zope] pythonmethods rock ! this should be part of zope.
> 
> 
> So, I'm using FTP (with Ultraedit on win32) which works great with
> dtml methods and dtml documents stored in folders but I can't open
> the following :
> a) pythonmethods, no matter where they are stored. why is this so ?

I have not tested this, but changing PythonMethods to support FTP should
be as trivial as adding the following methods to the PythonMethod class:

    def PUT(self, REQUEST, RESPONSE):
        """ Handle HTTP PUT requests """
        self.dav__init(REQUEST, RESPONSE)
        body=REQUEST.get('BODY', '')
        self._validateProxy(REQUEST)
        self._body = rstrip(body)
        self.makeFunction(1)
        RESPONSE.setStatus(204)
        return RESPONSE

    def manage_FTPget(self):
        "Get source for FTP download"
        return self._body

This has the added bonus of enabling HTTP PUTs and WebDAV.

-Michel