Thanks Gary,
There is indeed inline python code in the index.html.tmpl and I will also
make your suggest change to current.inc and see if that fixes it.
But closer investigation of my code has revealed the problem. This is how I
change the text in my barometer, so based on your suggestion I have changed
the top if statement to detect the value None in raw.
I then copied my old directory back which caused the error to reappear,
then made the change below to index.html.tmp which has indeed fixed the
error.
That is something I would have never found by myself so thank you very much
for your help.
So is if fair to say Python3 is more stringent when it comes to these types
of comparisons?
Trend : #if $trend.barometer.raw is not None
#if $trend.barometer.raw > 2.0
'Rising Rapidly'
#else if $trend.barometer.raw > 0.7
'Rising Slowly'
#else if $trend.barometer.raw < -2.0
'Falling Rapidly'
#else if $trend.barometer.raw < -0.7
'Falling Slowly'
#else
'Steady'
#end if
#else
'Steady'
#end if
On Sunday, March 8, 2020 at 12:45:09 PM UTC, gjr80 wrote:
>
> Mike,
>
> Stop looking for 'NoneType', you won't find anything that will help, its
> just the eror message structure. The clue is in the error message:
>
> Mar 08 09:00:16 raspberrypi weewxd[29345]: weewx[29345] ERROR weewx.
> cheetahgenerator: **** Ignoring template /home/weewx/skins/Seasons/index.
> html.tmpl
> Mar 08 09:00:16 raspberrypi weewxd[29345]: weewx[29345] ERROR weewx.
> cheetahgenerator: **** Reason: '>' not supported between instances of
> 'NoneType' and 'float'
> Mar 08 09:00:16 raspberrypi weewxd[29345]: weewx[29345] ERROR weewx.
> cheetahgenerator: **** Traceback (most recent call last):
> Mar 08 09:00:16 raspberrypi weewxd[29345]: weewx[29345] ERROR weewx.
> cheetahgenerator: **** File "/home/weewx/bin/weewx/cheetahgenerator.py"
> , line 322, in generate
> Mar 08 09:00:16 raspberrypi weewxd[29345]: weewx[29345] ERROR weewx.
> cheetahgenerator: **** unicode_string = compiled_template.respond()
> Mar 08 09:00:16 raspberrypi weewxd[29345]: weewx[29345] ERROR weewx.
> cheetahgenerator: **** File
> "_home_weewx_skins_Seasons_index_html_tmpl.py", line …, in respond
> Mar 08 09:00:16 raspberrypi weewxd[29345]: weewx[29345] ERROR weewx.
> cheetahgenerator: **** TypeError: '>' not supported between instances of
> 'NoneType' and 'float'
>
> The error indicates there is some in-line python code in the
> index.html.tmpl template that is comparing the python value None and a
> float using the > operator. Whilst the error refers to the index.html.tmpl
> template if you look in that template it actually includes a number of
> 'includes' ie the contents of other files. So you need to look through them
> (plus there is no > operator in index.html.tmpl).
>
> Actually the only > operator in any of the include files is in hilo.inc
> and current.inc. It happens ot be the same line of code in each:
>
> #if $day.ET.has_data and $day.ET.sum.raw > 0.0
>
>
> I suspect that is the cause of your issue and its intermittent nature is
> due to the periodic nature of the ET calculation. In the Seasons skin
> directory in each of hilo.inc and current.inc try chnaging that line to:
>
> #if $day.ET.has_data and $day.ET.sum.raw is not None and $day.ET.sum.raw > 0.0
>
> save the files (no need for restart) and see if the problem disappears.
>
> Gary
>
>
>
--
You received this message because you are subscribed to the Google Groups
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/weewx-user/38448e1b-d229-4360-9659-ec9e2004f42a%40googlegroups.com.