Skip to content

Add path shortcuts for common user-space paths #3551

@freakboy3742

Description

@freakboy3742

What is the problem or limitation you are having?

Toga has a paths module that provides an anchor point for paths in the app, and for common "sandbox" locations such as config, data, and logs.

However, there's no anchor for common "user space" locations, such as "Documents", "Pictures" or "Desktop". These are all locations that an app may want to use; and are cross platform (on desktop, anyway).

Describe the solution you'd like

paths.desktop, paths.pictures, and paths.desktop should all return appropriate user-specific file system anchors.

Describe alternatives you've considered

We could pass responsibility for this off to platformdirs, as it provides analogous functionality.

Additional context

  • On Linux, the FreeDesktop specification defines "known locations". The implementation provided by platformdirs could be used to inform what directories should be used, even if we don't actually use platformdirs in the implementation.
  • On macOS, permissions are often required to access Desktop, Documents etc; we should check if those permissions are requested automatically on first access, or if an explicit permission check is required.
  • On iOS (and Android?), there's probably not a folder that can be used for these paths. If there's no viable path, a platform should raise an exception.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew features, or improvements to existing features.good first issueIs this your first time contributing? This could be a good place to start!

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions