[Zope] DTML Syntax contd. + rant

Bruce Elrick belrick@home.com
Wed, 10 Nov 1999 17:04:58 -0700


Stuart 'Zen' Bishop wrote:
> 
> On Wed, 10 Nov 1999, Martijn Faassen wrote:
>> [deleted]
> I'm with you 100%. It makes me feel like I'm programming a reverse polish
> calculator sometimes :-)
> 
> A low-level user (one not confidant in writing external methods) shouldn't
> have use magic constructs like <dtml-var "_['sequence-item'].title_or_id()">
> dtml-in is the main culprit - a synonyms for the magic variables that conform
> to python naming standards need to be created and the old ones depricated.
> Is there any reason why I should fix this and submit the patch for 2.1?
> (or 2.2?)
> 


I thought, "What would it take to change sequence-item to sequence_item in
Zope?"

I did the following in my zope directory:
# find . -name '*.py' -exec grep sequence-item {} \; -print
         'sequence-item' -- The element.
            if sort=='sequence-item': self.sort=''
./lib/python/DocumentTemplate/DT_In.py
<!--#in sequence-item-->
   <!--#var sequence-item-->
<!--#/in sequence-item-->
           <!--#in sequence-item-->
              <!--#var sequence-item-->
           <!--#/in sequence-item-->
./lib/python/DocumentTemplate/DTtest.py
           <!--#var sequence-item-->
               value="<!--#in %s--><!--#var sequence-item-->
<!--#endin-->">'''
            --><!--#var sequence-item-->\n<!--#/in--></textarea>'''
                  <!--#if "_['sequence-item']=='%(id)s'"-->
                  ><!--#var sequence-item--></option>
./lib/python/ZClasses/Property.py

And then looked at the three files.  I also used 'nm' in a simlary fashion on
the .so files. I can't for the life of me figure out how the sequence-XXX
variable are defined.  The DT_In.py file certainly documents the variables,
but I can't figure out how they are implemented.  Maybe my lack of
understanding of Python is the problem.

Apologies if this belongs in zope-dev, but I'm not normally a developer
type...

Cheers...
Bruce
--
Bruce Elrick, Ph.D.                       Saltus Technology Consulting Group
Personal: belrick@home.com                          IBM Certified Specialist
Business: belrick@saltus.ab.ca          ADSM, AIX Support, RS/6000 SP, HACMP