Debugging a dtml page that won't save, found <dtml-if expr="exec=='1'">checked</dtml-if> is the culprit. exec is a Python reserved word, I discover. Can I use it anyway through some kind of escape notation in the expression, or do I have to change the database and all the other scripts I've spent a happy weekend writing? You'll gather I'm not a Python person (yet!), so please don't assume I'll know much background. Many thanks -- Mark Barratt Text Matters Information design: we help explain things using language | design | systems | process improvement ______________________________________________________ phone +44 (0)118 986 8313 email markb@textmatters.com web http://www.textmatters.com
Mark Barratt wrote:
exec is a Python reserved word, I discover. Can I use it anyway through some kind of escape notation in the expression, or do I have to change the database and all the other scripts I've spent a happy weekend writing?
Change any use of python or Zope reserved words to something else, or much pain and suffering will be your happy reward. How'd you know what they are? Well, urm... learn python for the python ones. For the Zope ones, use ZPT instead of DTML and you will find your fingernails claw away less of your flesh with frustration.... Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk
Chris Withers wrote:
Mark Barratt wrote:
exec is a Python reserved word, I discover. Can I use it anyway through some kind of escape notation in the expression, or do I have to change the database and all the other scripts I've spent a happy weekend writing?
Change any use of python or Zope reserved words to something else, or much pain and suffering will be your happy reward.
OK, done that.
How'd you know what they are?
Well, urm... learn python for the python ones.
One day. And for the next idiot: http://www-teaching.physics.ox.ac.uk/computing/Programming/Python/Oxford/htm... for python reserved words, and ... there aren't any extra for zope? (conversations on the list archive keep leaving me tantalisingly-short of an answer)
For the Zope ones, use ZPT instead of DTML and you will find your fingernails claw away less of your flesh with frustration....
This is an update to a chunky site all made in dtml. I've started getting my head round zpt but there don't seem to be any learning/reference tools for it and the zope.org site is what you said earlier. Thanks -- Mark Barratt Text Matters Information design: we help explain things using language | design | systems | process improvement ______________________________________________________ phone +44 (0)118 986 8313 email markb@textmatters.com web http://www.textmatters.com
On Monday 31 May 2004 01:33 pm, Chris Withers wrote:
Mark Barratt wrote:
exec is a Python reserved word, I discover. Can I use it anyway through some kind of escape notation in the expression, or do I have to change the database and all the other scripts I've spent a happy weekend writing?
Change any use of python or Zope reserved words to something else, or much pain and suffering will be your happy reward.
How'd you know what they are?
Well, urm... learn python for the python ones.
If you go through the effort of looking into python and zope reserved words, do yourself an enormous favor, and also do a little googling on naming conventions for those languages (regarding caps, underscores, etc.), as well. You can use 'legal' variable names that will be _very_ confusing six months or a year from now. If you're at the early stages, then adopting naming standards which are in common use, will make code matainance easier, and will make understanding other well formulated code, that much easier to understand.
For the Zope ones, use ZPT instead of DTML and you will find your fingernails claw away less of your flesh with frustration....
Chris
-- Dan Cherry dscherry@bellsouth.net
Dan Cherry wrote:
If you go through the effort of looking into python and zope reserved words, do yourself an enormous favor, and also do a little googling on naming conventions for those languages (regarding caps, underscores, etc.), as well.
You can use 'legal' variable names that will be _very_ confusing six months or a year from now. If you're at the early stages, then adopting naming standards which are in common use, will make code matainance easier, and will make understanding other well formulated code, that much easier to understand.
Good advice, Dan: reminds me that I know this from my work in SGML/XML document things but hadn't transferred the knowledge. Mark
Mark Barratt wrote at 2004-5-31 13:10 +0100:
Debugging a dtml page that won't save, found
<dtml-if expr="exec=='1'">checked</dtml-if>
is the culprit.
exec is a Python reserved word, I discover. Can I use it anyway through some kind of escape notation in the expression,
"_['exec']" (for simple values) or "_.getitem('exec')" (for callable objects that should not be called). -- Dieter
participants (4)
-
Chris Withers -
Dan Cherry -
Dieter Maurer -
Mark Barratt