[Zope-dev] tree tag question

Jonothan Farr jfarr@real.com
Fri, 17 Mar 2000 15:11:54 -0800


This is driving me crazy. I can't for the life of me figure out how dtml-tree is
hooked into the template machinery.

It looks like the tag is implemented in the class TreeDisplay.TreeTag.Tree. Yet
searching for these modules yields only:

---- TreeTag Matches (2) ----
__init__.py (c:\program files\zope\lib\python\treedisplay):import TreeTag
TreeTag.py (c:\program files\zope\lib\python\treedisplay):__rcs_id__='$Id:
TreeTag.py,v 1.39 1999/11/12 16:25:49 brian Exp $'
---- TreeDisplay Matches (3) ----
Globals.py (c:\program files\zope\lib\python):import TreeDisplay, string
Misc_.py (c:\program files\zope\lib\python\ofs):
pl=ImageFile('TreeDisplay/www/Plus_icon.gif')
Misc_.py (c:\program files\zope\lib\python\ofs):
mi=ImageFile('TreeDisplay/www/Minus_icon.gif')

Tree has too many matches to list, but none of them match the Tree class listed
above.

What blows me away is this bit from DocumentTemplate.DT_String:

    commands={
        'var': Var,
        'call': Call,
        'in': ('in', 'DT_In','In'),
        'with': ('with', 'DT_With','With'),
        'if': ('if', 'DT_If','If'),
        'unless': ('unless', 'DT_If','Unless'),
        'else': ('else', 'DT_If','Else'),
        'comment': Comment,
        'raise': ('raise', 'DT_Raise','Raise'),
        'try': ('try', 'DT_Try','Try'),
        'let': ('let', 'DT_Let', 'Let'),
        'return': ReturnTag,
        }

No tree!!

The in DT_String.parseTag and DT_HTML.parseTag:

        try: return tag, args, self.commands[name], None
        except KeyError:
            raise ParseError, ('Unexpected tag', tag)

No exception for 'tree'. I don't see 'parseTag' or 'commands' overridden in
DTMLMethod, nor is 'commands' overridden in DT_HTML.

This is with Zope version: Zope 2.1.4. The dtml-tree tag does work, I just can't
figure out how. Can someone in the know please take a moment to enlighten me?

Thanks,
-jfarr