[Zope] Passing args to PageTemplateFile instances

Peter Bengtsson peter at fry-it.com
Sat Sep 24 02:10:13 EDT 2005


2005/9/23, Anders Bruun Olsen <anders at bruun-olsen.net>:
> On Fri, Sep 23, 2005 at 12:39:31PM +0100, Peter Bengtsson wrote:
> > RESULT:
> > -------------------------------------------
> > Welcome to testprod
> > {'args': (<TestProd at /test/testprod used for /test/testprod>,
> > <HTTPRequest, URL=http://localhost:8080/test/testprod/test_testprod>),
> > 'something': 'blah'}
> > 0
> > /test/testprod
> > --------------------------------------------
> > http://www.peterbe.com/test/TestProd.tgz
> > So it works just fine in Zope 2.8.0
> > I suspect that the code you paste was idented wrong because the def
> > testit() function looked like it was part of the __init__ function.
>
> Yes, the paste was wrong, but there was more than that, I had my editor
> slightly misconfigured, which meant that the testit method was done with
> tab-indention and the rest of the file with space-indention. After I
> fixed that, it worked correctly and "something" shows up in options. I
> am absolutely stumped by why an indention problem can cause such a weird
> bug. I would have expected Zope/python to spew out an error telling me
> that indention was fucked up. To just silently make things not work is
> definitely not nice.
>
> Anyway, thank you so much for your help!
>

I'm still not convinced. The tabbing should either have led to a
SyntaxError or to testit() becoming a nested method. If it was a
nested method you wouldn't be able to reach it via the web like
http://localhost:8080/testprod/testit
But let's drop this now :)

If you're struggling with getting your editor to only use spaces
correctly you can ask the list for advise since there are many
different python progammers here with the same experience.

--
Peter Bengtsson,
work www.fry-it.com
home www.peterbe.com
hobby www.issuetrackerproduct.com


More information about the Zope mailing list