$to_list and $to_bool

43 views
Skip to first unread message

Jason Rennie

unread,
Feb 11, 2022, 6:31:41 PM2/11/22
to weewx...@googlegroups.com
Just got a weewx update via Ubuntu. I'm now at 4.6.2. Templates were failing to generate due to errors like:

Feb 11 18:20:16 weewx[6071] ERROR weewx.cheetahgenerator: **** Ignoring template /etc/weewx/skins/Seasons/statistics.html.tmpl
Feb 11 18:20:16 weewx[6071] ERROR weewx.cheetahgenerator: **** Reason: cannot find 'to_list'
Feb 11 18:20:16 weewx[6071] ERROR weewx.cheetahgenerator: **** To debug, try inserting '#errorCatcher Echo' at top of template
Feb 11 18:20:16 weewx[6071] ERROR weewx.cheetahgenerator: Evaluation of template /etc/weewx/skins/Seasons/telemetry.html.tmpl failed.

It looked like these functions in the templates might not be necessary, so I removed them... and templates are generating fine now. I'm guessing these might be an abstraction layer to future-proof against config values that may not evaluate to bool/list. Any hints as to what I might need to do to get these functions to work in the templates? I'm using "Seasons". E.g. here's what the top of my titlebar.inc looks like now:

## titlebar for weewx skins
## Copyright Tom Keffer, Matthew Wall
## See LICENSE.txt for your rights
#errorCatcher Echo
#encoding UTF-8

#set $show_rss = $DisplayOptions.get('show_rss', True)
#set $show_reports = $DisplayOptions.get('show_reports', True)

<div id="title_bar">

Was there maybe a change to weewx.conf or skin.conf that allowed templates access to these functions? I didn't accept those updates since they can break my setup.

Thanks!

Jason

matthew wall

unread,
Feb 11, 2022, 6:56:35 PM2/11/22
to weewx-user
On Friday, February 11, 2022 at 6:31:41 PM UTC-5 jre...@gmail.com wrote:
Just got a weewx update via Ubuntu. I'm now at 4.6.2. Templates were failing to generate due to errors like:
...
Was there maybe a change to weewx.conf or skin.conf that allowed templates access to these functions? I didn't accept those updates since they can break my setup.

the to_bool and to_list helpers are there to make skin parameterization work properly.  everything will probably work without them, but if you make changes in skin.conf or weewx.conf to change the default skin values, you might get unexpected results without to_bool and to_list.

an exception of "cannot find 'to_list'" is what one would see if you update the skin without updating and restarting weewx.  weewx older than 4.6.1 does not have 'to_list' or 'to_bool'.

Reply all
Reply to author
Forward
0 new messages