-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Implement site-wide configuration settings #1978
Conversation
pathlist = [] | ||
|
||
# just in case that var isn't set but the user tries to use xdg anyway | ||
xdg_path = os.path.join('/etc/xdg', appname) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit pick, couldn't this just be moved up top so that it says xdg_config_dirs = os.getenv('XDG_CONFIG_DIRS', '/etc/xdg')
? I think that follows the spec better since it states that /etc/xdg
is the default if XDG_CONFIG_DIRS
is not set.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess just in the case that someone does have XDG_CONFIG_DIRS but doesn't have /etc/xdg in that. But nah, stuff 'em.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, if they are attempting to use the XDG directories but
didn't configure it explicitly. It doesn't cost anything to
check it by default and actually makes it easier to explain.
Couple comments but this otherwise looks really good to me. |
* add site_config_dirs() to appdirs to determine locations across OSes * add system_config_files to locations.py * add system_config_files to get_config_files() and re-order files entries to correct precedence * document changes to configuration files in user guide Closes pypa#309
cd9ae65
to
aedca3c
Compare
Resubmitted with the Windows change in place. |
👍 Looks good! |
I (still) think we should do away with having different file extensions for the different OSes. Somewhat arbitrary, but I think Windows systems should also default to reading A use case would be someone storing a |
I don't disagree, but for this PR (which only adds a machine-wide file) we should be consistent with what's there already. When we change the user-specific filename, we should change this one to match, but let's be consistent for now. I know that means we need to consider migration in both places, but I don't think that's a big enough issue to delay this PR. |
I agree with @pfmoore, let's keep this PR focused. |
Implement site-wide configuration settings
Thank you @r1chardj0n3s ❤️ |
Closes #309