On Thursday, 19 September 2019 23:00:20 UTC+10, Thomas Keffer wrote:
>
> On Wed, Sep 18, 2019 at 11:37 PM gjr80 <gjrod...@gmail.com <javascript:>> 
> wrote:
>
>> That aside, whether you call it a bug or not I don't think we should have 
>> a tag that when you give it an allowed value/parameter it aborts the 
>> template. 
>>
>
> We don't. The tag that caused the error was user-supplied.
>

Technically you are right, but for my thinking the real cause is the 
underlying WeeWX native $span($month_delta=1). 
 

> As for Python, it doesn't even offer month arithmetic (at least, through 
> class datetime.timedelta), probably for the reasons we have discovered. 
> I'm thinking we should do the same.
>

I tend to agree, I appreciate that leaving an error for the user to trap 
and handle is a common way to handle such situations, but I still have a 
bit of a problem that a native WeeWX tag with quite acceptable parameters 
causes a template to fail. Providing $span with deltas of weeks, days etc 
down to seconds gives the user the flexibility to define their 'month' how 
they like (4 weeks, 30 or 31 days) 

At the end of the day if we were prepared to let the user catch an error 
from a tag in a template using some inline python, then equally we can let 
them implement a bit of inline python in their template to feed $span with 
whatever 'month ago' value they want.

And of course all the above applies equally as well to $year_delta.

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 weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/a64898d6-b6b4-48f5-8c48-0b984d27151f%40googlegroups.com.

Reply via email to