auto-pi-lot / autopilot

Distributed behavioral experiments
https://docs.auto-pi-lot.com
Mozilla Public License 2.0
93 stars 24 forks source link

autopilot.setup does not remember previous values for AGENT and AUDIOSERVER #184

Open cxrodgers opened 2 years ago

cxrodgers commented 2 years ago

When I run python autopilot.setup it generally remembers all the previous values for preferences. I assume it pulls them from prefs.json. The exception is AGENT and AUDIOSERVER, which always default to "TERMINAL" and "false".

Thus, running setup and accepting all defaults will reset AGENT and AUDIOSERVER in presf.json to "TERMINAL" and "false", whereas I think a more reasonable behavior is that accepting all defaults leaves the prefs file unchanged. I believe this is how all other prefs are handled (or else they are prefs I have left as default anyway, so wouldn't notice).

sneakers-the-rat commented 2 years ago

Also related to https://github.com/auto-pi-lot/autopilot/issues/155

Doing so should standardize the way that prefs are set and modified, so they can be modified from the GUI (using the model widget as the other models like Biography use) as well as building another TUI for the same. The current TUI is held together with string and duct-tape because the npyscreen package is sort of a mess, so likely will swap that out to use Textualize (but also having a clear load/save method from the Pydantic class, and the ability to edit prefs from the GUI which should also let us do it from the terminal for the pilots should make that less necessary anyway)