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

notify function and conf defaults #3

Open
AFriemann opened this issue May 31, 2017 · 3 comments
Open

notify function and conf defaults #3

AFriemann opened this issue May 31, 2017 · 3 comments

Comments

@AFriemann
Copy link

Hey there,

first of all thank you for this project. It comes down to a really nice solution overall.
Unfortunately I have 2 minor issues with it.

The notify function

While I agree that debug logging would be nice here, simply printing to stdout is kind of annoying. I'd like to have control over my application output without resorting to monkey patching your project. Using python logging would solve this easily

import logging
notify = logging.getLogger(__package__).debug

Would be the easiest solution here.

Config defaults

It would be nice to be able to set defaults for the configuration directory. E.g. I like to configure my projects from ~/.config/${PACKAGE}/config.{ini,yaml,cfg}.
Click comes with the get_app_dir() function which would make this really comfortable.
My current workaround is to set the environment variable

if not os.environ.get('CONF'):
    os.environ.update(CONF=click.get_app_dir(__package__))

Your type specification for the conf option gets in the way here, as exists is set to True and thus the directory needs to be created for this to work. It might be a good idea to make this behaviour configurable as well.

@bergundy
Copy link
Contributor

Hi,
I haven't used or maintained this project in a while.
You raise some valid points.
Is this still relevant to you?

@AFriemann
Copy link
Author

Hey @bergundy,

Me neither actually. I'd leave it up to you. I usually just resort to a json/yaml parser and a dict.

Would definitely add a note that it's more or less unmaintained though, since it still shows up in searches :)

@bergundy
Copy link
Contributor

Thanks for the suggestion,, will do.

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