[Zope-CVS] CVS: Packages/Moztop/idesupport/xmlrpc - configure.zcml:1.3 image.py:1.2

Stephan Richter srichter@cbu.edu
Thu, 16 Jan 2003 07:47:15 -0500


Update of /cvs-repository/Packages/Moztop/idesupport/xmlrpc
In directory cvs.zope.org:/tmp/cvs-serv17005/idesupport/xmlrpc

Modified Files:
	configure.zcml image.py 
Log Message:
- Image Upload is now working! Yeah!


=== Packages/Moztop/idesupport/xmlrpc/configure.zcml 1.2 => 1.3 ===
--- Packages/Moztop/idesupport/xmlrpc/configure.zcml:1.2	Thu Jan 16 04:55:37 2003
+++ Packages/Moztop/idesupport/xmlrpc/configure.zcml	Thu Jan 16 07:46:42 2003
@@ -14,6 +14,6 @@
       for="zope.app.interfaces.content.image.IImage"
       factory=".image.Methods"
       permission="Zope.Manage"
-      allowed_methods="getMetaData, setMetaData"/>
+      allowed_methods="getMetaData, setMetaData, upload"/>
 
 </zopeConfigure>


=== Packages/Moztop/idesupport/xmlrpc/image.py 1.1 => 1.2 ===
--- Packages/Moztop/idesupport/xmlrpc/image.py:1.1	Thu Jan 16 04:55:37 2003
+++ Packages/Moztop/idesupport/xmlrpc/image.py	Thu Jan 16 07:46:42 2003
@@ -15,10 +15,11 @@
 
 $Id$
 """
-import datetime
+import datetime, StringIO
 from zope.component import getAdapter
 from zope.publisher.xmlrpc import MethodPublisher
 from zope.app.interfaces.dublincore import IZopeDublinCore
+from zope.app.content.image import ImageSized
 
 class Methods(MethodPublisher):
     """ """
@@ -53,3 +54,17 @@
         return "Meta Data successfully changed."
 
     
+    def upload(self, data, content_type=''):
+        """ """
+        data = StringIO.StringIO(data)
+        self.context.data = data
+        return 'Upload successful!'
+
+
+    def getImageInfo(self):
+        """ """
+        return {'size': ImageSized(self.context).sizeForDisplay(),
+                'content_type' : self.context.contentType}
+        
+
+