RE: [Zope] How to get the DTML code from a document/method?
<SNIP>
(this was from trying /dtml_source?path=index_html but path='anything else' gives the same error).
What about http://server.org/dtml_source?path=/index_html The leading slash is significant by virtue of the split in the source.
Is there a reason why there are two return statements in the external method, when it seems that only the return doc.read_raw() is going to be called?
Yeah -- because slacker Rob didn't read before clicking send. Chris Petrilli also noted this. The second return in, um, optional. :^) --Rob
<SNIP>
(this was from trying /dtml_source?path=index_html but path='anything else' gives the same error).
What about http://server.org/dtml_source?path=/index_html The leading slash is significant by virtue of the split in the source.
I appreciate the feedback Rob, but 'there is one small problem...' I still get the same traceback unfortunately. <!-- Error type: Error value: read-only buffer, class --> <!-- Traceback (innermost last): File lib/python/ZPublisher/Publish.py, line 877, in publish_module File lib/python/ZPublisher/Publish.py, line 590, in publish (Info: /dtml_source) File lib/python/OFS/DTMLDocument.py, line 212, in __call__ (Object: dtml_source) File lib/python/OFS/DTMLDocument.py, line 208, in __call__ (Object: dtml_source) File lib/python/DocumentTemplate/DT_String.py, line 513, in __call__ (Object: dtml_source) File lib/python/DocumentTemplate/DT_Var.py, line 239, in render (Object: view_source(path)) File lib/python/DocumentTemplate/DT_Util.py, line 266, in eval (Object: view_source(path)) File <string>, line 0, in ? File lib/python/Products/ExternalMethod/ExternalMethod.py, line 254, in __call__ (Object: CopySource) (Info: (('/index_html',), {}, None)) TypeError: (see above) --> Ok, what dullard thing am I doing wrong? ------ Dr Tony McDonald, FMCC, Networked Learning Environments Project The Medical School, Newcastle University Tel: +44 191 222 5888 Fingerprint: 3450 876D FA41 B926 D3DD F8C3 F2D0 C3B9 8B38 18A2
I've did a patch that adds a download tab to all documents, there's a method added to the document that download the source. You may have some problems since it changes the mime type. I've just adapted it to 1.10.2. If anyone interested I can send it. Shouldn't we have a patch area in the Zope site? regards, -- Paulo Eduardo Neves PUC-Rio de Janeiro Pager: Central: 292-4499 cod. 213 99 64 ou use a URL: http://www.learn.fplf.org.br/neves/mensagempager.html
participants (3)
-
Paulo Eduardo Neves -
Rob Page -
Tony McDonald