-
Notifications
You must be signed in to change notification settings - Fork 220
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 XDG Base Directory specification #405
Conversation
A note on |
96762dc
to
97c4605
Compare
For some reason, I've successfully tested this code locally with a POSIX-compliant environment in all scenarios I could think of. |
Rethinking this, I suppose |
`ia` will attempt the following paths in this order, using the first existing file: - `${XDG_CONFIG_HOME}/internetarchive/ia.ini` (with `XDG_CONFIG_HOME` defaulting to `~/.config` if not set or invalid; see code comment regarding `~` vs `$HOME`) - `~/.config/ia.ini` - `~/.ia` When none of these paths exist on creating a config file (`ia configure`), the first one is used and directories are created as necessary.
97c4605
to
6ea1c7a
Compare
I made that change from I would still like to figure out why the build failed though. I wrote to Travis CI, and they confirmed that Also, I still want to add some tests here to ensure that a #399 situation can't happen again. So this isn't ready for merging yet. |
4c1f09a
to
036e116
Compare
036e116
to
e966daf
Compare
I took a quick look at the implementation of |
I understand PY2 is EOL, but it's still widely used in reality and something I would like to support as long as we're able to. Any changes made in support of |
Alright, I understand. To be clear, it's only the tests that are held back by this; the actual code should not be Py3-specific in any way. I'll try to write a minimal crutch for Py2 that emulates the key part of |
f11e907
to
b780432
Compare
This simplifies testing of the latter method greatly as there is no need to mock get_auth_config. This separation also makes much more sense from the naming side of things.
67a069c
to
8857f30
Compare
8857f30
to
57fb317
Compare
I realised today that This should now be ready for review and merging. :-) |
Thanks again, @JustAnotherArchivist! |
ia
will attempt the following paths in this order, using the first existing file:${XDG_CONFIG_HOME}/internetarchive/ia.ini
(withXDG_CONFIG_HOME
defaulting to${HOME}/.config
if not set or invalid)~/.config/ia.ini
~/.ia
When none of these paths exist on creating a config file (
ia configure
), the first one is used and directories are created as necessary.Closes #400