[ZPatterns] SkinScript: manage_FTPput / manage_FTPget

Jean Jordaan [email protected]
Thu, 1 Nov 2001 16:28:36 +0200


Hi Steve

> If you post a patch using one of the diff options Anthony
> mentioned, I'll include this in the next release of
> TransactionAgents/ZedPatterns.

Great :)  How's this?

Regards,
Jean

--- Methods.py	Thu Nov  1 16:24:00 2001
+++ /home/httpd/zope/Products/ZPatterns/SkinScript/Methods.py	Fri Oct 26
16:00:46 2001
@@ -119,6 +119,10 @@



+    def manage_FTPget(self):
+        "Get source for FTP download"
+        self.REQUEST.RESPONSE.setHeader('Content-Type', 'text/plain')
+        return self.read()


     def PUT(self, REQUEST, RESPONSE):
@@ -130,6 +134,12 @@
         RESPONSE.setStatus(204)
         return RESPONSE

+    manage_FTPput = PUT
+
+    def read(self): return self.text
+    def get_size(self): return len(self.text)
+    getSize = get_size
+
     def manage_proxy(self, roles=(), REQUEST=None):
         "Change Proxy Roles"
         r = ProxyManager.manage_proxy.im_func(self,roles,REQUEST)
@@ -143,7 +153,7 @@
     __ac_permissions__ = (
         ('Change proxy roles', ('manage_proxy')),
         ('View management screens',  ('manage_uploadForm','manage_main')),
-        ('Change SkinScript
methods',('manage_upload','PUT','manage_edit')),
+        ('Change SkinScript
methods',('manage_upload','PUT','manage_edit','manage_FTPget','body')),
     )