Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gracefully upgrade settings.txt file #39

Open
indivisible-irl opened this issue Nov 22, 2013 · 7 comments
Open

Gracefully upgrade settings.txt file #39

indivisible-irl opened this issue Nov 22, 2013 · 7 comments

Comments

@indivisible-irl
Copy link
Member

If needed settings cannot be found due to out of date settings file then store whatever setting scan be read and generate a new settings.txt containing the previously configured options.

There should also be a setting to force the regen of the file when needed.
Gets flipped back to False after one run.
Will need to be ignored if reading from settings.py like heroku bot does. (or maybe just let is fail trying?)

@projectdelphai
Copy link
Member

Maybe a version option in the settings.txt. It it's out of date than a new setting.txt is created and the old one is saved as settings.txt.save or something.

@indivisible-irl
Copy link
Member Author

sounds good.

leaving it on the todo pile for the moment. concentrating on the 'help' and 'user' functionalities.
if someone want to do this they're more than welcome

@indivisible-irl
Copy link
Member Author

Copied from reddit thread:

On new version, existing (retained) settings should be preserved and reapplied to the newly generated settings.txt so preferences don't get lost between updates.

If there is a bot breaking change that needs to be applied and handled manually by the dev/maintainer we could perhaps have a 'halt' boolean that will sys.exit() and print how to resolve the conflict to console.

@kzisme
Copy link
Contributor

kzisme commented Dec 13, 2013

Has anyone made more work towards this being complete? I haven't seen a thread in the sub, so I'm just posting here.

@projectdelphai
Copy link
Member

Nope.

@stoye
Copy link
Contributor

stoye commented Sep 25, 2014

Poking this issue, too. Two questions: why is the configuration file a text file (as opposed to a YAML, or some other standard configuration format)? There are a lot of nice libraries for these other formats (such as pyyaml) that would make reading a configuration file trivial. If this is desired/interesting I can whip up a pull request.

Second, why isn't the settings file under version control?

@projectdelphai
Copy link
Member

As to why the settings file is not in yaml or something similar: I think it was originally, just because the settings file was small and no one saw a need for it. But as it grew larger, it just never got ported over to a better configuration library.

It wasn't under version control I believe because the application itself creates the settings file if it doesn't exist. Not sure if that's a benefit or not. Here is the relevant pull request.

If you feel that the process can be made better, a pull request would be welcomed.

@stoye stoye mentioned this issue Sep 27, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants