[Zope] Question of the week

Dieter Maurer dieter@handshake.de
Mon, 18 Jun 2001 23:06:12 +0200 (CEST)


Eric Vautour writes:
 > ....
 >  <dtml-var level1_header>
 >  <dtml-var level1_sidebar>
 >  <dtml-var l1_phoneit>
 >  <dtml-var l1_dialit>
 >  <dtml-var l1_findit>
 >  <dtml-var level1_footer>
 >  
 >  I was wondering if there was a way that I could extract the
 > information from this ".htm" object so that I could determine which
 > objects are being called from it, excluding the header, footer, and
 > sidebar.
You can, if you have sufficient privileges:

    If you have a DTML object, you can use its method
    "document_src" to obtain its source (You must have
    the role 'View management screens').

    You can then use "string.split" to split the source
    into lines and slice access to select the
    variables names, e.g. "line[10:-2]".

More info: Python library reference and Python manual.


Dieter