[Zope] To retrieve properties from a dtml document

Oliver Bleutgen Oliver Bleutgen <myzope@gmx.net>
Tue, 19 Dec 2000 21:07:48 +0100


> Hello Andy, thanks for the advice.
> It didn't work. Maybe I'm wrong at any point, so please tell me whether
> it worked for you.

> I'm aware that this problem has been discussed here before, that it
> happens because of Python's object naming, and also that there's a
> workaround at least (and just)for expressions, using _['whatever.html']

> Due to the kind of workflow we have, we need all of the documents to be
> editable with Dreamweaver at any moment, directly, after the daily WGET
> process. Batch-replacing every "_html" with ".html" in file names and
> content seems to be very complicated within this scenario.

not overly complicated,
here is a slightly modfied script (untested) which I used 
for a similar task (creating an "offline"-version for a client):

#!/usr/bin/bash
rm -rf myimport
wget -r -k http://192.168.0.201:10080/
mv 192.168.0.201/ myimport/
rm myimport/index.html
perl -pi -e 's/<base href="http:\/\/192.168.0.201:10080.*//g' `find myimport/ -type f`
perl -pi -e 's/(.*)_html/$1\.html/g' `find myimport/ -type f`
mmv ';*_html' '#1#2.html'
zip -r myimport.zip myimport/*


Things to check

- Check the regular expressions and mmv part, I had to change them without testing 
(not certain about the (.*) and the mmv (-> multiple move) syntax)
- Instead of relying on _html to mark html-files one could use file(1) - but then
one would have to make a list of renamed files in order to change the relevant
links
- Improve the regex for changing links, it might capture _html in text (but how
often does that occure)

cheers,
oliver




_______________________________________________
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 )