> what I'd like to know is what lines had to be changed in the templates to > make it work with python3?
You can see exactly what I changed here: https://github.com/chaunceygardiner/weewx-exfoliation/commit/19ec9af514b2b32076713967911a9e5baffb6930 > On Sep 3, 2020, at 2:01 PM, Timothy Buchanan <[email protected]> > wrote: > > Thanks, that port does work, and forecast already worked. My skin is > modified from exfoliation, so what I'd like to know is what lines had to be > changed in the templates to make it work with python3? > >> On Thursday, September 3, 2020 at 2:44:53 PM UTC-6 [email protected] wrote: >> I did a quick port of exfoliation for someone who wanted to get it to work >> with WeeWX 4/Py3. >> >> You are welcome to try it: >> https://github.com/chaunceygardiner/weewx-exfoliation >> >> If you want it to work with the forecast plugin, I have that working with >> WeeWX4/Py3 at: >> https://github.com/chaunceygardiner/weewx-forecast >> >> >>>> On Sep 3, 2020, at 12:20 PM, Timothy Buchanan <[email protected]> >>>> wrote: >>>> >>> I have a similar problem with python3 and extension. The index and history >>> pages are being generated. I made the first change listed above, but my >>> index template doesn't have a show_pop. Here is the syslog extract: >> >>> >>> >>> Sep 3 13:15:22 raspberrypi weewx[8261] ERROR weewx.cheetahgenerator: >>> Generate failed with exception '<class 'TypeError'>' >>> Sep 3 13:15:22 raspberrypi weewx[8261] ERROR weewx.cheetahgenerator: **** >>> Ignoring template /etc/weewx/skins/exfoliation/index.html.tmpl >>> Sep 3 13:15:22 raspberrypi weewx[8261] ERROR weewx.cheetahgenerator: **** >>> Reason: '>' not supported between instances of 'NoneType' and 'int' >>> Sep 3 13:15:22 raspberrypi weewx[8261] ERROR weewx.cheetahgenerator: **** >>> Traceback (most recent call last): >>> Sep 3 13:15:22 raspberrypi weewx[8261] ERROR weewx.cheetahgenerator: **** >>> File "/usr/share/weewx/weewx/cheetahgenerator.py", line 322, in generate >>> Sep 3 13:15:22 raspberrypi weewx[8261] ERROR weewx.cheetahgenerator: **** >>> unicode_string = compiled_template.respond() >>> Sep 3 13:15:22 raspberrypi weewx[8261] ERROR weewx.cheetahgenerator: **** >>> File >>> "cheetah__etc_weewx_skins_exfoliation_index_html_tmpl_1599160522_6806855_35363.py", >>> line 1380, in respond >>> Sep 3 13:15:22 raspberrypi weewx[8261] ERROR weewx.cheetahgenerator: **** >>> TypeError: '>' not supported between instances of 'NoneType' and 'int' >>> Sep 3 13:15:23 raspberrypi weewx[8261] ERROR weewx.cheetahgenerator: >>> Generate failed with exception '<class 'TypeError'>' >>> Sep 3 13:15:23 raspberrypi weewx[8261] ERROR weewx.cheetahgenerator: **** >>> Ignoring template /etc/weewx/skins/exfoliation/forecast.html.tmpl >>> Sep 3 13:15:23 raspberrypi weewx[8261] ERROR weewx.cheetahgenerator: **** >>> Reason: '>' not supported between instances of 'NoneType' and 'int' >>> Sep 3 13:15:23 raspberrypi weewx[8261] ERROR weewx.cheetahgenerator: **** >>> Traceback (most recent call last): >>> Sep 3 13:15:23 raspberrypi weewx[8261] ERROR weewx.cheetahgenerator: **** >>> File "/usr/share/weewx/weewx/cheetahgenerator.py", line 322, in generate >>> Sep 3 13:15:23 raspberrypi weewx[8261] ERROR weewx.cheetahgenerator: **** >>> unicode_string = compiled_template.respond() >>> Sep 3 13:15:23 raspberrypi weewx[8261] ERROR weewx.cheetahgenerator: **** >>> File "_etc_weewx_skins_exfoliation_forecast_html_tmpl.py", line 384, in >>> respond >>> Sep 3 13:15:23 raspberrypi weewx[8261] ERROR weewx.cheetahgenerator: **** >>> File "/usr/lib/python3/dist-packages/Cheetah/Template.py", line 1707, in >>> _handleCheetahInclude >>> Sep 3 13:15:23 raspberrypi weewx[8261] ERROR weewx.cheetahgenerator: **** >>> self._CHEETAH__cheetahIncludes[_includeID].respond(trans) >>> Sep 3 13:15:23 raspberrypi weewx[8261] ERROR weewx.cheetahgenerator: **** >>> File "_etc_weewx_skins_exfoliation_forecast_table_inc.py", line 530, in >>> respond >>> Sep 3 13:15:23 raspberrypi weewx[8261] ERROR weewx.cheetahgenerator: **** >>> TypeError: '>' not supported between instances of 'NoneType' and 'int >>> >>>> On Saturday, July 11, 2020 at 4:23:13 PM UTC-6 [email protected] wrote: >>>> I changed the first one and all my errors went away. I’m not sure I was >>>> having the second part of the error. >>>> >>>> >>>> >>>> >>>> >>>> Thanks, >>>> >>>> Scott KB2EAR >>>> >>>> http://weather.kb2ear.net/exfoliation >>>> >>>> >>>> >>>> >>>> >>>> From: [email protected] <[email protected]> On Behalf Of >>>> Tom Keffer >>>> Sent: Saturday, July 11, 2020 6:07 PM >>>> To: weewx-user <[email protected]> >>>> Subject: Re: [weewx-user] Issue with exfoliation weewx 4.1.1 and python3 - >>>> I think? >>>> >>>> >>>> >>>> For the first error, in file index.html.tmpl, line 226, change this >>>> >>>> >>>> >>>> #if $varExists('trend') and $trend.windSpeed.raw is not None >>>> >>>> $get_windspeed_trend($trend.windSpeed.formatted) >>>> >>>> #end if >>>> >>>> >>>> >>>> to this >>>> >>>> >>>> >>>> #if $varExists('trend') and $trend.windSpeed.raw is not None >>>> >>>> $get_windspeed_trend($trend.windSpeed.raw) >>>> >>>> #end if >>>> >>>> >>>> >>>> For the second error, there are a number of candidates that could be >>>> causing this problem. I'd go with this one. Change this >>>> >>>> >>>> >>>> #if $show_pop >>>> >>>> <td class='col-pop'> >>>> >>>> #if $period.pop.raw > 0 >>>> >>>> $period.pop.format('%.0f',' ') >>>> >>>> #end if >>>> >>>> <br/> >>>> >>>> #if $period.qpf.raw > 0 >>>> >>>> $period.qpf.nolabel('%.2f',' ') <img class='pop-img' >>>> src='icons/raindrop.png' /> >>>> >>>> #end if >>>> >>>> <br/> >>>> >>>> #if $period.qsf.raw > 0 >>>> >>>> $period.qsf.nolabel('%.2f',' ') <img class='pop-img' >>>> src='icons/snowflake.png' /> >>>> >>>> #end if >>>> >>>> </td> >>>> >>>> #end if >>>> >>>> >>>> >>>> to this >>>> >>>> >>>> >>>> #if $show_pop >>>> >>>> <td class='col-pop'> >>>> >>>> #if $period.pop.raw is not None and $period.pop.raw > 0 >>>> >>>> $period.pop.format('%.0f',' ') >>>> >>>> #end if >>>> >>>> <br/> >>>> >>>> #if $period.qpf.raw is not None and $period.qpf.raw > 0 >>>> >>>> $period.qpf.nolabel('%.2f',' ') <img class='pop-img' >>>> src='icons/raindrop.png' /> >>>> >>>> #end if >>>> >>>> <br/> >>>> >>>> #if $period.qsf.raw is not None and $period.qsf.raw > 0 >>>> >>>> $period.qsf.nolabel('%.2f',' ') <img class='pop-img' >>>> src='icons/snowflake.png' /> >>>> >>>> #end if >>>> >>>> </td> >>>> >>>> #end if >>>> >>>> >>>> >>>> But I could be wrong on that. >>>> >>>> >>>> >>>> -tk >>>> >>>> >>>> >>>> >>>> >>>> On Thu, Jun 4, 2020 at 6:14 AM Mike Thompson >>>> <[email protected]> wrote: >>>> >>>> Hi Fourm & Matt, >>>> >>>> >>>> >>>> I'm getting an issue with exfoliation to do with data types the message in >>>> the log is "Reason: '>' not supported between instances of 'NoneType' and >>>> 'int'" >>>> >>>> >>>> >>>> I've just migrated from 3.9.1 on RPI Ib running Wheezy. >>>> >>>> Upgraded to 3.9.1 on RPI 1B running Buster with Python 2. All was working >>>> OK >>>> >>>> Upgraded to 4.1.1 on Python3 and the issue occurred. >>>> >>>> As apart of the upgrade to 4.1.1 on Python3 I had to make changes to >>>> alarm.py etc to update python2 code to python3 >>>> >>>> Installed latest exfoliation (0.45) and forecast (3.4.0b1) extensions. It >>>> looks like exfoliation has over written my customisations so I think it's >>>> "out of the box" >>>> >>>> >>>> >>>> Seasons is working - pages and graphs generate OK. >>>> >>>> Forecast seems to be working. Sample pages generated OK, most without data >>>> but UK met office data on forecast-periods page. Time stamp on files in >>>> public_html/forecast are recent i.e post upgrade. >>>> >>>> Some Exfoliation pages are generated OK and some not, index and forecast >>>> are not but history, almanac and links are. >>>> >>>> >>>> >>>> From syslog it looks like get_windspeed_trend is causing the issue >>>> >>>> Jun 4 13:01:27 weepi weewx[8650] ERROR weewx.cheetahgenerator: Generate >>>> failed with exception '<class 'TypeError'>' >>>> Jun 4 13:01:27 weepi weewx[8650] ERROR weewx.cheetahgenerator: **** >>>> Ignoring template /home/weewx/skins/exfoliation/index.html.tmpl >>>> Jun 4 13:01:27 weepi weewx[8650] ERROR weewx.cheetahgenerator: **** >>>> Reason: '>' not supported between instances of 'str' and 'int' >>>> Jun 4 13:01:27 weepi weewx[8650] ERROR weewx.cheetahgenerator: **** >>>> Traceback (most recent call last): >>>> Jun 4 13:01:27 weepi weewx[8650] ERROR weewx.cheetahgenerator: **** >>>> File "/home/weewx/bin/weewx/cheetahgenerator.py", line 322, in generate >>>> Jun 4 13:01:27 weepi weewx[8650] ERROR weewx.cheetahgenerator: **** >>>> unicode_string = compiled_template.respond() >>>> Jun 4 13:01:27 weepi weewx[8650] ERROR weewx.cheetahgenerator: **** >>>> File "_home_weewx_skins_exfoliation_index_html_tmpl.py", line 1292, in >>>> respond >>>> Jun 4 13:01:27 weepi weewx[8650] ERROR weewx.cheetahgenerator: **** >>>> File "_home_weewx_skins_exfoliation_index_html_tmpl.py", line 497, in >>>> __errorCatcher43 >>>> Jun 4 13:01:27 weepi weewx[8650] ERROR weewx.cheetahgenerator: **** >>>> File "<string>", line 1, in <module> >>>> Jun 4 13:01:27 weepi weewx[8650] ERROR weewx.cheetahgenerator: **** >>>> File "_home_weewx_skins_exfoliation_index_html_tmpl.py", line 187, in >>>> get_windspeed_trend >>>> Jun 4 13:01:27 weepi weewx[8650] ERROR weewx.cheetahgenerator: **** >>>> TypeError: '>' not supported between instances of 'str' and 'int' >>>> >>>> from index.html.tmpl; >>>> >>>> #def get_windspeed_trend($x) >>>> #if $x > 0 >>>> ⇧ >>>> #elif $x < 0 >>>> ⇩ >>>> #end if >>>> #end def >>>> >>>> >>>> >>>> I'm also seeing; >>>> >>>> >>>> Jun 4 13:01:32 weepi /weewxd: forecast: ReportThread: _get_stats: '>' not >>>> supported between instances of 'NoneType' and 'float' >>>> >>>> >>>> >>>> around 50 of them followed by >>>> >>>> Jun 4 13:01:34 weepi weewx[8650] ERROR weewx.cheetahgenerator: Generate >>>> failed with exception '<class 'TypeError'>' >>>> Jun 4 13:01:34 weepi weewx[8650] ERROR weewx.cheetahgenerator: **** >>>> Ignoring template /home/weewx/skins/exfoliation/forecast.html.tmpl >>>> Jun 4 13:01:34 weepi weewx[8650] ERROR weewx.cheetahgenerator: **** >>>> Reason: '>' not supported between instances of 'NoneType' and 'int' >>>> Jun 4 13:01:34 weepi weewx[8650] ERROR weewx.cheetahgenerator: **** >>>> Traceback (most recent call last): >>>> Jun 4 13:01:34 weepi weewx[8650] ERROR weewx.cheetahgenerator: **** >>>> File "/home/weewx/bin/weewx/cheetahgenerator.py", line 322, in generate >>>> Jun 4 13:01:34 weepi weewx[8650] ERROR weewx.cheetahgenerator: **** >>>> unicode_string = compiled_template.respond() >>>> Jun 4 13:01:34 weepi weewx[8650] ERROR weewx.cheetahgenerator: **** >>>> File "_home_weewx_skins_exfoliation_forecast_html_tmpl.py", line 384, in >>>> respond >>>> Jun 4 13:01:34 weepi weewx[8650] ERROR weewx.cheetahgenerator: **** >>>> File "/usr/lib/python3/dist-packages/Cheetah/Template.py", line 1707, in >>>> _handleCheetahInclude >>>> Jun 4 13:01:34 weepi weewx[8650] ERROR weewx.cheetahgenerator: **** >>>> self._CHEETAH__cheetahIncludes[_includeID].respond(trans) >>>> Jun 4 13:01:34 weepi weewx[8650] ERROR weewx.cheetahgenerator: **** >>>> File "_home_weewx_skins_exfoliation_forecast_table_inc.py", line 538, in >>>> respond >>>> Jun 4 13:01:34 weepi weewx[8650] ERROR weewx.cheetahgenerator: **** >>>> TypeError: '>' not supported between instances of 'NoneType' and 'int' >>>> >>>> >>>> >>>> It may have something to do with changes and extensions I've made over the >>>> years. To be fair, I've just bumped along working this out from first >>>> principles until it worked so it's highly likely I've not implemented >>>> changes correctly >>>> >>>> From my weewx.conf the only section regarding exfoliation is; >>>> >>>> [[exfoliation]] >>>> HTML_ROOT = public_html/exfoliation >>>> skin = exfoliation >>>> #radar_local_img = >>>> http://radar.weather.gov/ridge/lite/N0R/BOX_loop.gif >>>> #radar_regional_img = >>>> http://radar.weather.gov/ridge/Conus/Loop/northeast_loop.gif >>>> #radar_national_img = >>>> http://images.intellicast.com/WxImages/Radar/usa.gif >>>> >>>> # MT Addition for forecast and alltime,sevenday >>>> [[[CheetahGenerator]]] >>>> search_list_extensions = user.forecast.ForecastVariables, >>>> user.stats.MyStats >>>> >>>> >>>> >>>> I've run with exfoliation commented out in weewx.conf as well as >>>> enabled=false and weewx is running without error >>>> >>>> >>>> >>>> Syslog attached. >>>> >>>> before 09:35 I was running 3.9.1 on Python 2 >>>> >>>> after 09:35 4.1.1 on python 3 >>>> >>>> post 12:36:37 debug is turned on >>>> >>>> >>>> >>>> Thanks in Advance >>>> >>>> -- >>>> 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/19346a94-d78e-4732-9d6d-36fb7a22ab2e%40googlegroups.com. >>>> >>>> -- >>>> 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/CAPq0zEArY3s7nDTX0QnLT8hNzeRsFh%3Dt3QZ-8UYiqXa1dzEFRA%40mail.gmail.com. >>>> >>>> >>> >>> -- >>> 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/b43793aa-6d14-4157-8994-560699f86017n%40googlegroups.com. > > -- > 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/3e8ac1a9-0adf-4dc3-83ff-8f119d793b90n%40googlegroups.com. -- 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/DA982ABD-B05E-44CE-9540-6044AEB78B8C%40johnkline.com.
