Skip to content

Switch to user_config_dir - #6

Open
Serial-ATA wants to merge 1 commit into
kasper9n:masterfrom
Serial-ATA:patch-2
Open

Switch to user_config_dir#6
Serial-ATA wants to merge 1 commit into
kasper9n:masterfrom
Serial-ATA:patch-2

Conversation

@Serial-ATA

Copy link
Copy Markdown
Contributor

I think these files are better suited for the config dir. I'm always going there looking for the files and getting thrown off when I can't find them 😅.

@kasper9n

kasper9n commented Aug 11, 2022

Copy link
Copy Markdown
Owner

It looks like appdirs.user_config_dir points to ~/Library/Preferences on macOS, which goes against OS guidelines:

Preferences

Contains the user’s preferences. You should never create files in this directory yourself. To get or set preference values, you should always use the NSUserDefaults class or an equivalent system-provided interface.

Opened ActiveState/appdirs#185 about that

@Serial-ATA

Copy link
Copy Markdown
Contributor Author

appdirs doesn't really seem to be maintained. Should another library be used instead?

@kasper9n

Copy link
Copy Markdown
Owner

Could do that if there's a good alternative out there

@Serial-ATA

Copy link
Copy Markdown
Contributor Author

Yeah, I looked around and couldn't find anything 🤷. I'll make a PR and hope it gets noticed.

@Serial-ATA

Copy link
Copy Markdown
Contributor Author

I doubt the PR will get any attention, so I just made a special case for macOS.

@kasper9n

Copy link
Copy Markdown
Owner

It actually looks like using platformdirs is a good alternative. They have the same problem, but it's being maintained - opened tox-dev/platformdirs#98

I also think the roaming folder should probably be used on Windows

Comment thread vidl/config.py Outdated
@Serial-ATA

Copy link
Copy Markdown
Contributor Author

I wonder if these projects would even be willing to make such a change, given how old they are.

@kasper9n

Copy link
Copy Markdown
Owner

We'd have to see what they say in the issue I suppose

In the meantime it would be fine to keep the special macOS handling

@Serial-ATA

Copy link
Copy Markdown
Contributor Author

I'm not familiar with macOS, the path would be ~/Library/Application Support/Kasper Henningsen.vidl right? I was looking here, but I'm not sure.

@kasper9n

Copy link
Copy Markdown
Owner

Reverse domain name notation is used sometimes (I use space.kasper.<appname> for desktop apps), so it would be space.kasper.vidl in that case. For vidl, I'm not sure I'd want to use that if it's just on one platform though

@Serial-ATA

Copy link
Copy Markdown
Contributor Author

So just ~/Library/Application Support/vidl?

@kasper9n

Copy link
Copy Markdown
Owner

yeah, and that's also what's used currently

@Serial-ATA

Copy link
Copy Markdown
Contributor Author

Alright, should be good now.

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

Successfully merging this pull request may close these issues.

2 participants