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

platformdirs: introduce user_pictures_dir() #167

Merged
merged 1 commit into from
Apr 25, 2023
Merged

Conversation

kemzeb
Copy link
Contributor

@kemzeb kemzeb commented Apr 25, 2023

Introduces the means to acquire the user's pictures directory path.

Feature suggested in #141.

I have included tests (thanks to user_documents_dir much of the code including testing code was borrowed). I did test this on Windows and MacOS and from calling this function they do produce expected results. However I'm not familiar with Android with the exception of some of the developer web pages I explored that allowed me to find the DIRECTORY_PICTURES constant, and I also don't have access to an Android device so I have not tested it in a similar manner as Windows and MacOS.

The following are just references to the code changes I made that I thought were worth mentioning:
Android:

Unix:

Windows:

Introduces the means to acquire the user's pictures directory path.

Feature suggested from tox-dev#141.
@kemzeb
Copy link
Contributor Author

kemzeb commented Apr 25, 2023

The most recent snapshot adds the similar logic of user_documents_dir() and user_pictures_dir() in unix.py into a helper function called _get_user_media_dir(). This will make it easier to introduce other user media directories.

@gaborbernat gaborbernat merged commit 4edf8ac into tox-dev:main Apr 25, 2023
@ofek
Copy link
Collaborator

ofek commented Apr 25, 2023

Awesome stuff!

@ofek ofek mentioned this pull request Apr 25, 2023
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.

3 participants