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

Consolidate configuration to a single file #62

Open
pricebenjamin opened this issue Sep 17, 2019 · 3 comments
Open

Consolidate configuration to a single file #62

pricebenjamin opened this issue Sep 17, 2019 · 3 comments

Comments

@pricebenjamin
Copy link
Contributor

Currently, fresh.py reads from three separate configuration files: .config.ini, credentials.json, and praw.ini.

To make initialization easier for new users, I propose we expect a single configuration file, config.ini (no longer hidden), with the following structure:

[spotify]
username = <username>
client_id = <client_id>
client_secret = <client_secret>
redirect_uri = <redirect_uri>

[reddit]
username = <username>
client_id = <client_id>
client_secret = <client_secret>

Note that we request the reddit username as well. This allows us to create a user-agent string that better follows the reddit API rules. (Better user-agent strings will be requested in a separate issue.)

@pricebenjamin
Copy link
Contributor Author

I've created a branch which implements the above proposal, but it does so at the cost of trampling over other contributors' code. A more community-friendly approach should be taken before creating a pull request. I'll leave a link as a resource for future work on this issue.

https://github.com/pricebenjamin/fresh_script/tree/consolidate-config

@dtcrout
Copy link
Contributor

dtcrout commented Oct 9, 2019

Maybe there's something that can be used from my Spotify project? I've made a PR on this project in regards to the config, but since then it's been improved:

  • Config variables are consolidated into one file and loaded using configparser
  • The config file is generated using a Makefile making it standardized for new contributors/users to create a config file skeleton
  • There is documentation with images on how to obtain Spotify credentials

Maybe these features can be added to the project?

@pricebenjamin
Copy link
Contributor Author

@dtcrout, your project is a great reference. Thank you for the input!

Having a tool, like a Makefile, generate a skeleton config file is also a good idea. This could perhaps be addressed in a separate issue.

We would still need to address the problem of consolidating all configuration parameters into one file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants