There is no parameter 'context' for long_form(), but you can specify a
'format'. I'm not sure what problem you're trying to solve, but if it's
that you need formatting for a week, while $current assumes something less
than a day, try

*$current.obstype.long_form(format="%(day)d%(day_label)s,
%(hour)d%(hour_label)s, %(minute)d%(minute_label)s")*


-tk

On Mon, Apr 17, 2023 at 7:17 AM Karen K <[email protected]> wrote:

> There is no parameter `context` in `long_form`. So it is clear that the
> example can not work.
>
> Consequently the error log looks like that:
>
> Apr 16 20:40:18 LokalWiki weewx[116925] ERROR weewx.cheetahgenerator:
> Evaluation of template /etc/weewx/skins/Belchertown1_3/index.html.tmpl
> failed with exception '<class 'TypeError'>'
>
> Apr 16 20:40:18 LokalWiki weewx[116925] ERROR weewx.cheetahgenerator: ****
> Ignoring template /etc/weewx/skins/Belchertown1_3/index.html.tmpl
>
> Apr 16 20:40:18 LokalWiki weewx[116925] ERROR weewx.cheetahgenerator: ****
> Reason: long_form() got an unexpected keyword argument 'context'
>
> Apr 16 20:40:18 LokalWiki weewx[116925] ERROR weewx.cheetahgenerator:
> ****  Traceback (most recent call last):
>
> Apr 16 20:40:18 LokalWiki weewx[116925] ERROR weewx.cheetahgenerator:
> ****    File "/usr/share/weewx/weewx/cheetahgenerator.py", line 348, in
> generate
>
> Apr 16 20:40:18 LokalWiki weewx[116925] ERROR weewx.cheetahgenerator:
> ****      unicode_string = compiled_template.respond()
>
> Apr 16 20:40:18 LokalWiki weewx[116925] ERROR weewx.cheetahgenerator:
> ****    File
> "cheetah__etc_weewx_skins_Belchertown1_3_index_html_tmpl_1681669818_8877633_12239.py",
> line 1852, in respond
>
> Apr 16 20:40:18 LokalWiki weewx[116925] ERROR weewx.cheetahgenerator:
> ****    File "/usr/lib/python3/dist-packages/Cheetah/Template.py", line
> 1708, in _handleCheetahInclude
>
> Apr 16 20:40:18 LokalWiki weewx[116925] ERROR weewx.cheetahgenerator:
> ****      self._CHEETAH__cheetahIncludes[_includeID].respond(trans)
>
> Apr 16 20:40:18 LokalWiki weewx[116925] ERROR weewx.cheetahgenerator:
> ****    File
> "cheetah__etc_weewx_skins_Belchertown1_3_index_hook_after_charts_inc_1681670418_9296255_76052.py",
> line 406, in respond
>
> Apr 16 20:40:18 LokalWiki weewx[116925] ERROR weewx.cheetahgenerator:
> ****  TypeError: long_form() got an unexpected keyword argument 'context'
>
> --
> You received this message because you are subscribed to the Google Groups
> "weewx-development" 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-development/5925305e-a9fb-4c20-a686-52c7a56b9120n%40googlegroups.com
> <https://groups.google.com/d/msgid/weewx-development/5925305e-a9fb-4c20-a686-52c7a56b9120n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-development" 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-development/CAPq0zECwQY_7cSZy4am%2B8vvvd%3DABSGroChZ%3D6QiVgSwVRpqifQ%40mail.gmail.com.

Reply via email to