Re: [Rest2web-develop] processing uservalues as a test condition in a template
Brought to you by:
mjfoord
|
From: Ben <bi...@ma...> - 2008-03-22 18:16:15
|
Michael Foord wrote:
> if localnavbar == 'yes'
Hi, Michael,
Thank you for your email and have a good Easter holiday!
I'm afraid I tried this syntax as well, and I get an error since the
localnavbar doesn't seem to be defined [1].
This is what I've put in 2 rest files header:
uservalues
localnavbar: yes
/uservalues
(to let you know, about 30 other files don't have this value defined,
if it matters?)
and the error is:
Processing indexfile.
Guessing encoding. We guessed: UTF-8
Building stage.html
[err] Traceback (most recent call last):
[err] File "/usr/bin/r2w", line 170, in <module>
[err] count = main(options, config)
[err] File "/usr/bin/r2w", line 103, in main
[err] return processor.walk()
[err] File
"/var/lib/python-support/python2.5/rest2web/restprocessor.py", line 468,
in walk
[err] errorcheck = self.execute_safely(self.buildsection)
[err] File
"/var/lib/python-support/python2.5/rest2web/restprocessor.py", line 218,
in execute_safely
[err] val = function(*args, **keywargs)
[err] File
"/var/lib/python-support/python2.5/rest2web/restprocessor.py", line
1463, in buildsection
[err] thepage = render_well(temp_file, namespace,
final_encoding=final_encoding)
[err] File
"/var/lib/python-support/python2.5/rest2web/embedded_code.py", line 89,
in render_well
[err] template = render(template, namespace,
uservalues,final_encoding=final_encoding)
[err] File
"/var/lib/python-support/python2.5/rest2web/embedded_code.py", line 72,
in render
[err] value = fun(occ, namespace)
[err] File
"/var/lib/python-support/python2.5/rest2web/embedded_code.py", line 142,
in render_value_exec
[err] exec codeobj in namespace
[err] File "<string>", line 2, in <module>
[err] NameError: name 'localnavbar' is not defined
[err]
(for your information, stage.txt does not have such a localnavbar value)
-- Ben
[1] yes, I've tried again and I fixed the little typo in your example
(ocalnavbar -> localnavbar).
|