Should this 'break' statement work?

$for line in file_bundle:
    $for chunk in line:
        $if chunk == "%LINK%":
            WOOT!
            $break  <------------- here..
        $else:
            $chunk

.. because here is the error I am getting:

Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/web/webapi.py", line 312, in
wsgifunc
    result = func()
  File "/usr/lib/python2.4/site-packages/web/request.py", line 129, in
<lambda>
    func = lambda: handle(getattr(mod, name), mod)
  File "/usr/lib/python2.4/site-packages/web/request.py", line 61, in
handle
    return tocall(*([x and urllib.unquote(x) for x in args] + fna))
  File "/srv/www/lighttpd/oracle-webpy-test.py", line 421, in GET
    print render.fastedifiles(fastedijob, file_bundle, urllist)
  File "/usr/lib/python2.4/site-packages/web/template.py", line 498,
in __call__
    return f.go()
  File "/usr/lib/python2.4/site-packages/web/template.py", line 759,
in go
    self.output._str = ''.join(map(self.h, self.parsetree))
  File "/usr/lib/python2.4/site-packages/web/template.py", line 552,
in h
    return getattr(self, 'h_' + item[WHAT])(item)
  File "/usr/lib/python2.4/site-packages/web/template.py", line 727,
in h_for
    out.extend(self.h_lines(i[BODY]))
  File "/usr/lib/python2.4/site-packages/web/template.py", line 755,
in h_lines
    return map(self.h, lines)
  File "/usr/lib/python2.4/site-packages/web/template.py", line 552,
in h
    return getattr(self, 'h_' + item[WHAT])(item)
  File "/usr/lib/python2.4/site-packages/web/template.py", line 727,
in h_for
    out.extend(self.h_lines(i[BODY]))
  File "/usr/lib/python2.4/site-packages/web/template.py", line 755,
in h_lines
    return map(self.h, lines)
  File "/usr/lib/python2.4/site-packages/web/template.py", line 552,
in h
    return getattr(self, 'h_' + item[WHAT])(item)
  File "/usr/lib/python2.4/site-packages/web/template.py", line 709,
in h_if
    return ''.join(self.h_lines(do))
  File "/usr/lib/python2.4/site-packages/web/template.py", line 755,
in h_lines
    return map(self.h, lines)
  File "/usr/lib/python2.4/site-packages/web/template.py", line 552,
in h
    return getattr(self, 'h_' + item[WHAT])(item)
  File "/usr/lib/python2.4/site-packages/web/template.py", line 683,
in h_line
    o = self.h(x[NAME])
  File "/usr/lib/python2.4/site-packages/web/template.py", line 552,
in h
    return getattr(self, 'h_' + item[WHAT])(item)
  File "/usr/lib/python2.4/site-packages/web/template.py", line 675,
in h_var
    raise NameError, 'could not find %s (line %s)' % (repr(i[NAME]), i
[LINENO])
NameError: could not find 'break' (line 21)

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web.py" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/webpy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to