Cheetah error after update to WeeWX 4.6.2

210 views
Skip to first unread message

František Slimařík

unread,
Feb 21, 2022, 5:03:33 AM2/21/22
to weewx-user
Hello, 

can you gimme small hint what should be checked in cheetah template after updated to version 4.6.2? I am using python3 and after update all templates works fine except main one. Unfortunately for me I made much of customizations there so I ´d like to know to which part I should focus mainly :)

Feb 21 11:00:39 new-weather-machine journal: weewx[22334] ERROR weewx.cheetahgenerator: Evaluation of template /etc/weewx/skins/neowx/index.html.tmpl failed with exception '<class 'TypeError'>'
Feb 21 11:00:39 new-weather-machine journal: weewx[22334] ERROR weewx.cheetahgenerator: **** Ignoring template /etc/weewx/skins/neowx/index.html.tmpl
Feb 21 11:00:39 new-weather-machine journal: weewx[22334] ERROR weewx.cheetahgenerator: **** Reason: %x format: an integer is required, not dict
Feb 21 11:00:39 new-weather-machine journal: weewx[22334] ERROR weewx.cheetahgenerator: **** Traceback (most recent call last):
Feb 21 11:00:39 new-weather-machine journal: weewx[22334] ERROR weewx.cheetahgenerator: **** File "/usr/share/weewx/weewx/cheetahgenerator.py", line 344, in generate
Feb 21 11:00:39 new-weather-machine journal: weewx[22334] ERROR weewx.cheetahgenerator: **** unicode_string = compiled_template.respond()
Feb 21 11:00:39 new-weather-machine journal: weewx[22334] ERROR weewx.cheetahgenerator: **** File "_etc_weewx_skins_neowx_index_html_tmpl.py", line 1273, in respond
Feb 21 11:00:39 new-weather-machine journal: weewx[22334] ERROR weewx.cheetahgenerator: **** File "/usr/share/weewx/weewx/units.py", line 1005, in __str__
Feb 21 11:00:39 new-weather-machine journal: weewx[22334] ERROR weewx.cheetahgenerator: **** s = self.toString()
Feb 21 11:00:39 new-weather-machine journal: weewx[22334] ERROR weewx.cheetahgenerator: **** File "/usr/share/weewx/weewx/units.py", line 1000, in toString
Feb 21 11:00:39 new-weather-machine journal: weewx[22334] ERROR weewx.cheetahgenerator: **** localize=localize)
Feb 21 11:00:39 new-weather-machine journal: weewx[22334] ERROR weewx.cheetahgenerator: **** File "/usr/share/weewx/weewx/units.py", line 688, in toString
Feb 21 11:00:39 new-weather-machine journal: weewx[22334] ERROR weewx.cheetahgenerator: **** s = self._to_string(val_t, context, addLabel, useThisFormat, None_string, localize)
Feb 21 11:00:39 new-weather-machine journal: weewx[22334] ERROR weewx.cheetahgenerator: **** File "/usr/share/weewx/weewx/units.py", line 748, in _to_string
Feb 21 11:00:39 new-weather-machine journal: weewx[22334] ERROR weewx.cheetahgenerator: **** val_str = self.delta_secs_to_string(val_t[0], format_string)
Feb 21 11:00:39 new-weather-machine journal: weewx[22334] ERROR weewx.cheetahgenerator: **** File "/usr/share/weewx/weewx/units.py", line 796, in delta_secs_to_string
Feb 21 11:00:39 new-weather-machine journal: weewx[22334] ERROR weewx.cheetahgenerator: **** ans = locale.format_string(label_format, etime_dict)
Feb 21 11:00:39 new-weather-machine journal: weewx[22334] ERROR weewx.cheetahgenerator: **** File "/usr/lib64/python3.6/locale.py", line 233, in format_string
Feb 21 11:00:39 new-weather-machine journal: weewx[22334] ERROR weewx.cheetahgenerator: **** new_val.append(format(perc.group(), val, grouping))
Feb 21 11:00:39 new-weather-machine journal: weewx[22334] ERROR weewx.cheetahgenerator: **** File "/usr/lib64/python3.6/locale.py", line 194, in format
Feb 21 11:00:39 new-weather-machine journal: weewx[22334] ERROR weewx.cheetahgenerator: **** return _format(percent, value, grouping, monetary, *additional)
Feb 21 11:00:39 new-weather-machine journal: weewx[22334] ERROR weewx.cheetahgenerator: **** File "/usr/lib64/python3.6/locale.py", line 200, in _format
Feb 21 11:00:39 new-weather-machine journal: weewx[22334] ERROR weewx.cheetahgenerator: **** formatted = percent % value
Feb 21 11:00:39 new-weather-machine journal: weewx[22334] ERROR weewx.cheetahgenerator: **** TypeError: %x format: an integer is required, not dict

František Slimařík

unread,
Feb 21, 2022, 7:28:53 AM2/21/22
to weewx-user
Ok, I found the issue. I was using following extension  vinceskahan/vds-weewx-lastrain-extension: extension for weewx to generate some lastrain timestamps and delta time reports (github.com) which was updated recently for version 4.6.0. But I found also another interesting thing, following tags are shown as N/A instead of value:

$current.windGustDir.ordinal_compass
$day.wind.gustdir.ordinal_compass

Following tag is OK:
$current.windDir.ordinal_compass

I am using observer driver.

Dne pondělí 21. února 2022 v 11:03:33 UTC+1 uživatel František Slimařík napsal:

František Slimařík

unread,
Feb 21, 2022, 1:59:53 PM2/21/22
to weewx-user
OK, I see windGust issue is already discussed/solved here: https://groups.google.com/g/weewx-user/c/9N8gg44u8Q0/m/BjKbIuvcBQAJ

So all issues solved :)

Dne pondělí 21. února 2022 v 13:28:53 UTC+1 uživatel František Slimařík napsal:
Reply all
Reply to author
Forward
0 new messages