<tr>
<td class="label">$obs.label.extraTemp6</td>
#for $archive in $archive_data
<td class="data new_row hilo_$archive[0]">
<span title="$archive[1]($data_binding='sdr_binding').extraTemp6.maxtime">
$archive[1]($data_binding='sdr_binding').extraTemp6.max.format(add_label=False)</span><br/>
<span title="$archive[1]($data_binding='sdr_binding').extraTemp6.mintime">
$archive[1]($data_binding='sdr_binding').extraTemp6.min.format(add_label=False)</span>
</td>
#end for
<td class="units">$unit.label.extraTemp6</td>
</tr>
---->
Sep 1 14:15:29 raspberrypi weewx-tfa[6844]: cheetahgenerator: Generate failed with exception '<type 'exceptions.SyntaxError'>'
Sep 1 14:15:29 raspberrypi weewx-tfa[6844]: cheetahgenerator: **** Ignoring template /home/weewx/skins/Seasons-TFA/index.html.tmpl
Sep 1 14:15:29 raspberrypi weewx-tfa[6844]: cheetahgenerator: **** Reason: keyword can't be an expression (_home_weewx_skins_Seasons_TFA_hilo_inc.py, line 162)
Sep 1 14:15:29 raspberrypi weewx-tfa[6844]: **** Traceback (most recent call last):
Sep 1 14:15:29 raspberrypi weewx-tfa[6844]: **** File "/home/weewx/bin/weewx/cheetahgenerator.py", line 332, in generate
Sep 1 14:15:29 raspberrypi weewx-tfa[6844]: **** fd.write(str(compiled_template))
Sep 1 14:15:29 raspberrypi weewx-tfa[6844]: **** File "/usr/lib/python2.7/dist-packages/Cheetah/Template.py", line 1045, in __str__
Sep 1 14:15:29 raspberrypi weewx-tfa[6844]: **** rc = getattr(self, mainMethName)()
Sep 1 14:15:29 raspberrypi weewx-tfa[6844]: **** File "_home_weewx_skins_Seasons_TFA_index_html_tmpl.py", line 352, in respond
Sep 1 14:15:29 raspberrypi weewx-tfa[6844]: **** File "/usr/lib/python2.7/dist-packages/Cheetah/Template.py", line 1685, in _handleCheetahInclude
Sep 1 14:15:29 raspberrypi weewx-tfa[6844]: **** file=file)
Sep 1 14:15:29 raspberrypi weewx-tfa[6844]: **** File "/usr/lib/python2.7/dist-packages/Cheetah/Template.py", line 832, in compile
Sep 1 14:15:29 raspberrypi weewx-tfa[6844]: **** raise e
Sep 1 14:15:29 raspberrypi weewx-tfa[6844]: **** File "_home_weewx_skins_Seasons_TFA_hilo_inc.py", line 162
Sep 1 14:15:29 raspberrypi weewx-tfa[6844]: **** SyntaxError: keyword can't be an expression
Michael
So, later, it interprets an expression like
$archive[1](data_binding='wx_binding')...
as being a call to a TimeSpanBinder, rather than a call to a constructor.
The only way I can think of to get around this is to refactor the archive_data expression so it reads
#set $archive_data = [('day', $day, $day(data_binding='sdr_binding')), ('week', $week, $week(data_binding='sdr_binding')), ('month', $month, $month(data_binding='sdr_binding')), ('year', $year, $year(data_binding='sdr_binding')), ('rainyear', $rainyear, $rainyear(data_binding='sdr_binding'))]
Each tuple now consists of (a string, a plain TimeSpanBinder, and a TimeSpanBinder bound to the sdr_binding data binding) --- what you want.
Now your block looks like
<tr>
<td class="label">$obs.label.extraTemp6</td>
#for $archive in $archive_data
<td class="data new_row hilo_$archive[0]">
<span title="$archive[2].extraTemp6.maxtime">
$archive[2].extraTemp6.max.format(add_label=False)</span><br/>
<span title="$archive[2].extraTemp6.mintime">
$archive[2].extraTemp6.min.format(add_label=False)</span>
</td>
#end for
<td class="units">$unit.label.extraTemp6</td>
</tr>
Hope this helps.
-tk
--
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 weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/7ab94a55-f037-4638-9e19-4915baa64c8b%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx...@googlegroups.com.