I just found out that I forgot to cc this to the list: ---------- Forwarded Message ---------- Subject: Re: [Zope] External files Date: Tue, 10 Jul 2001 23:59:33 +0200 From: Thomas Olsen <tol@tanghus.dk> To: Dieter Maurer <dieter@handshake.de> OK - I'll try to be a bit more clear :-) The File('www/my.jar') was simply my unqualified guess that when you could make a DTMLMethod object using DTMLFile('dtml/editForm', globals()) then maybe you could create a File Object doing something similar ;-} - but that wasn't so... What I wan't to do is to create some File objects using python containing a jar file (application/x-jar) and a java class file (application/x-java). When I do it using the web management screens (Select type to add... => File) everything works ok but I cant find out how to do it programmatically. On Tuesday 10 July 2001 20:30, you wrote:
Thomas Olsen writes:
This is propably an FAQ but I couldn't find an answer to it: I'm extending a product which has a java applet on one of the management screens. How do I get the class file and the jar? I've tried something like:
--cut------------- def my_jar(self, REQUEST): return self._my_jar
_my_jar = File('www/my.jar') --cut-------------
but that absolutely didn't work...
And what happened?
A few more questions (we need more context):
* what is the "File" above. Where did you get it from?
* usually, you should not simply return objects but rather their content.
If "_my_jar" is really a "OFS.Image.File" object, then you may succeed, as ZPublisher will convert the object returned into a string, which give the content for a "File" object.
Dieter
-- Regards Thomas Olsen ------------------------------------------------------- -- Regards Thomas Olsen
Thomas Olsen writes:
What I wan't to do is to create some File objects using python containing a jar file (application/x-jar) and a java class file (application/x-java). You may find "App.ImageFile.ImageFile" useful.
Its "__str__" is for images, but you probably will not use it anyway. The whole rest works for files, too. Dieter
Hi Ok - that sounds good - will try tomorrow when the retzina has cleared from my head ;-) The name is a bit misleading; ones tends to think that it'd only work for image files. Thanks On Thursday 12 July 2001 19:58, Dieter Maurer wrote:
Thomas Olsen writes:
What I wan't to do is to create some File objects using python containing a jar file (application/x-jar) and a java class file (application/x-java).
You may find "App.ImageFile.ImageFile" useful.
Its "__str__" is for images, but you probably will not use it anyway. The whole rest works for files, too.
Dieter
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
-- Regards Thomas Olsen
participants (2)
-
Dieter Maurer -
Thomas Olsen