This worked for me:

*echo -e "hood river\n700, foot\n45\n-125\nn\nmetric\n3\n" | python3
./setup.py install*

Adding new options to setup.py adds a LOT of complexity. Hence, the
decision to get rid of it.

-tk

On Sat, May 2, 2020 at 5:43 PM Vince Skahan <vinceska...@gmail.com> wrote:

> On Friday, May 1, 2020 at 6:36:24 PM UTC-7, Tom Keffer wrote:
>>
>> echo "hood river\n700,foot\n45\n-125\nmetric\n6\n\n\n" | python
>> ./setup.py install
>>
>> NB: this worked for V3.x. Version 4 asks the user whether s/he wants to
>> register the station, so you'd have to add that.
>>
>>>
>>>
> Yeah, that's a fail for me here.   No matter how many \n are in there, it
> barfs right around the altitude prompt.   You might want to try it on your
> system and see if you have better luck.
>
>
> Rather than battle that much more, I'm trying to re-add the old
> --no-prompt option back in (and hopefully send you a PR) and I'd appreciate
> some pointers on my approach.  What I was thinking was adding a
> command-line option to setup.py again, and simply returning a default set
> of values if that option is set.
>
> So in bin/weecfg/__init.py I'd add this to prompt_for_info() at the
> top....and something similar in prompt_for_driver() as well.
>
>
> +    if defaultConfig:
> +        default_stn_info = {}
> +        default_stn_info['location'] = "My Little Town, Oregon"
> +        default_stn_info['altitude'] = [700, 'foot']
> +        default_stn_info['latitude'] = 45
> +        default_stn_info['longitude'] = -121
> +        default_stn_info['register_this_station'] = "false"
> +        default_stn_info['units'] = "us"
> +        return default_stn_info
> +
>
>
> If I hard define defaultConfig at the top of the file right under your
> DEFAULT_URL variable, the code works as expected.   If it's set True, it
> skips prompts nicely.  If not, it prompts.  Exactly what I'm looking for.
> But it's hard-wired and of course needs to be more flexible.
>
> Question I have is how would I get a setup.py commandline option to this
> routine in __init.py__ for weecfg ?
>
> I guess I'm a bit lost in the internals of how all this stuff is put
> together under the hood.  Pointers appreciated.
>
> --
> 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 weewx-development+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/weewx-development/6732c32d-6164-4796-a2e7-eeef2d691d80%40googlegroups.com
> <https://groups.google.com/d/msgid/weewx-development/6732c32d-6164-4796-a2e7-eeef2d691d80%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 weewx-development+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-development/CAPq0zEDezPQDrhoUSCjCe5rcPyRCLYkM0Cgaicu3D7Y-LCVpjA%40mail.gmail.com.

Reply via email to