gjr80 / weewx-saratoga

A WeeWX extension to support the Saratoga Weather Website Templates
GNU Affero General Public License v3.0
3 stars 2 forks source link

install.py doesn't enable WEEWXtags/Clientraw skins #9

Open ktrue opened 3 years ago

ktrue commented 3 years ago

Did a fresh install today and noticed that the WEEWXtags/Clientraw skins were not being generated.

install.py has

[StdReport]
    [[WEEWXtagsReport]]
        skin = WEEWXtags
        enable = True
        [[[Units]]]
            [[[[TimeFormats]]]]
                date_f = %d/%m/%Y
                date_time_f = %d/%m/%Y %H:%M
    [[ClientrawReport]]
        skin = Clientraw
        enable = True

I had to change weewx.conf to:

[StdReport]
    [[WEEWXtagsReport]]
        skin = WEEWXtags
        enable = true
        [[[Units]]]
            [[[[TimeFormats]]]]
                date_f = %d/%m/%Y
                date_time_f = %d/%m/%Y %H:%M
    [[ClientrawReport]]
        skin = Clientraw
        enable = true

to enable them. I guess that True != true in python3.

gjr80 commented 3 years ago

Certainly in pure python True != true. However, when WeeWX processes a config setting that may be Boolean a helper function is used to force a Boolean result from any reasonable facsimile of a Boolean value. This includes the words true and false, yes and no, y and n in any mix of case. 1 and 0 are also accepted. Here is the line that does this for ‘enable’.

I did make changes to how the config options are set in install.py since you last upgraded. But as far as I can see the only possible value install.py could use for enable is True (it would need to explicitly set enable = False to disable the skin). I could be there is some odd behaviour on a clean install, to be truthful I did not test that scenario.

So not sure what happened here, will try a fresh install on a VM and see what that throws up.