Loading ...
Sorry, an error occurred while loading the content.

[Cheetahtemplate-discuss] serious compile error

Expand Messages
  • robert_kuzelj@yahoo.com
    hi tavis, i think i found a serious error concerning the placeholder syntax. here the code and the error. ... Traceback (most recent call last): File
    Message 1 of 2 , Jun 6, 2002
    • 0 Attachment
      hi tavis,

      i think i found a serious error concerning
      the placeholder syntax.

      here the code and the error.

      >>> mapper = {"list": []}
      >>> txt = "#silent ${list.append(1)}"
      >>> tpl = Template(txt, searchList=[mapper])
      Traceback (most recent call last):
      File "<interactive input>", line 1, in ?
      File "c:\develop\Python22\Lib\site-packages\Webware\Cheetah\Template.py",
      line 201, in __init__
      self.compile(source, file)
      File "c:\develop\Python22\Lib\site-packages\Webware\Cheetah\Template.py",
      line 232, in compile
      compiler.compile()
      File "c:\develop\Python22\Lib\site-packages\Webware\Cheetah\Compiler.py",
      line 1057, in compile
      self.parse()
      File "c:\develop\Python22\Lib\site-packages\Webware\Cheetah\Parser.py",
      line 1034, in parse
      self.eatDirective()
      File "c:\develop\Python22\Lib\site-packages\Webware\Cheetah\Parser.py",
      line 1149, in eatDirective
      self.directiveEaters[directiveKey]()
      File "c:\develop\Python22\Lib\site-packages\Webware\Cheetah\Parser.py",
      line 1531, in eatSilent
      expr = self.getExpression()
      File "c:\develop\Python22\Lib\site-packages\Webware\Cheetah\Parser.py",
      line 933, in getExpression
      token = self.getCheetahVar()
      File "c:\develop\Python22\Lib\site-packages\Webware\Cheetah\Parser.py",
      line 635, in getCheetahVar
      return self.getCheetahVarBody(plain=plain)
      File "c:\develop\Python22\Lib\site-packages\Webware\Cheetah\Parser.py",
      line 638, in getCheetahVarBody
      return self.genCheetahVar(self.getCheetahVarNameChunks(), plain=plain)
      File "c:\develop\Python22\Lib\site-packages\Webware\Cheetah\Compiler.py",
      line 110, in genCheetahVar
      return self.genNameMapperVar(nameChunks)
      File "c:\develop\Python22\Lib\site-packages\Webware\Cheetah\Compiler.py",
      line 164, in genNameMapperVar
      chunk = nameChunks.pop()
      IndexError: pop from empty list
      >>>

      if the text is without the braces everything works fine.
      >>> txt = "#silent $list.append(1)"
      i guess it should work either way, shouldnt it?

      ciao robertj

      ------------------------------------------------------------
      Robert Kuzelj
      Gaissacherstrasse 7 email: robert_kuzelj@...
      81371 Muenchen tel: 0177/5302230

      the trinity of desirables of (software) architecture:
      Firmitas, Utilitas, Venustas (marcus vitruvius 20 BC)
      strength, utility, beauty



      _______________________________________________________________

      Don't miss the 2002 Sprint PCS Application Developer's Conference
      August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm

      _______________________________________________
      Cheetahtemplate-discuss mailing list
      Cheetahtemplate-discuss@...
      https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
    • Mike Orr
      ... I used to get that with I m out of $$ now and then separately with #set $x, $y = $getImageDimensions($image) but in both cases Tavis did something to fix
      Message 2 of 2 , Jun 6, 2002
      • 0 Attachment
        On Thu, Jun 06, 2002 at 05:00:25PM +0200, robert_kuzelj@... wrote:
        > >>> txt = "#silent ${list.append(1)}"

        > IndexError: pop from empty list

        I used to get that with
        I'm out of $$ now
        and then separately with
        #set $x, $y = $getImageDimensions($image)
        but in both cases Tavis did "something" to fix it.

        --
        -Mike (Iron) Orr, iron@... (if mail problems: mso@...)
        http://iron.cx/ English * Esperanto * Russkiy * Deutsch * Espan~ol

        _______________________________________________________________

        Don't miss the 2002 Sprint PCS Application Developer's Conference
        August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm

        _______________________________________________
        Cheetahtemplate-discuss mailing list
        Cheetahtemplate-discuss@...
        https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
      Your message has been successfully submitted and would be delivered to recipients shortly.