Hi all - I have a file that needs to be customized on download and I would like to know how to do this in a Python script. My first attempt: return container.downloadFile() complained about the call. Removing the () seems to work better, but it is still far from clear to me how I - Obtain the content of a specific id in a given container; - Modify that content; - Return that content; Any clues gratefully accepted. TIA, - rmgw <http://www.trustedmedianetworks.com/> ---------------------------------------------------------------------------- Richard Wesley Trusted Media Networks, Inc. "Does anybody really know what time it is? Does anybody really care?" - Chicago
return container.downloadFile()
complained about the call. Removing the () seems to work better, but it is still far from clear to me how I
That would just return a method pointer/reference.
- Obtain the content of a specific id in a given container; - Modify that content; - Return that content;
suppose you have a File object with id "myfile.txt" Then:: data = getattr(container, "myfile.txt").data if day=="tuesday": data = "%s\nToday is tuesday" RESPONSE.setHeader('Content-type','application/data') RESPONSE.setHeader('Content-Disposition','inline;filename=myfile.txt' ) return data Hope that helps! Peter
Any clues gratefully accepted.
TIA,
- rmgw
<http://www.trustedmedianetworks.com/>
---------------------------------------------------------------------------- Richard Wesley Trusted Media Networks, Inc.
"Does anybody really know what time it is? Does anybody really care?" - Chicago
_______________________________________________ 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 )
--- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.361 / Virus Database: 199 - Release Date: 2002-05-07
--- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.361 / Virus Database: 199 - Release Date: 2002-05-07
On Tue, Jun 04, 2002 at 12:19:03AM +0100, Peter Bengtsson wrote:
suppose you have a File object with id "myfile.txt" Then::
data = getattr(container, "myfile.txt").data
if day=="tuesday": data = "%s\nToday is tuesday"
Sorry, Python newbie here, but shouldn't that read data = "%s\nToday is tuesday" % data ? Regards, Uwe -- Uwe Schuerkamp Tel: +49 (0)5241 / 80 10 66, FAX: - / 6 23 38 Uwe.Schuerkamp@nionex.net Nionex GmbH, IWN5 (http://www.nionex.de/) GnuPG KeyID: 5887047D Avenwedder Str. 55, 33311 Guetersloh GnuPG Fingerprint: 2E 13 20 22 9A 3F 63 7F 67 6F E9 B1 A8 36 A4 61
participants (3)
-
Peter Bengtsson -
Richard Wesley -
Uwe Schuerkamp