Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changes/3551.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Implement Documents, Desktop & Pictures paths in the Dummy backend and update the simple test app to print them.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of comments here:

  • This should be 3551.feature.rst file - it's a new feature, not a miscellanous update; and it's RST content
  • It should be phrased in the form of a release note:
Suggested change
Implement Documents, Desktop & Pictures paths in the Dummy backend and update the simple test app to print them.
App paths now expose locations for Documents, Desktop & Pictures folders.

4 changes: 4 additions & 0 deletions core/tests/testbed/interactive.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ def main():
print(f"app.paths.logs={app.paths.logs.resolve()}")
print(f"app.paths.toga={app.paths.toga.resolve()}")

print(f"app.paths.documents={app.paths.documents}")
print(f"app.paths.desktop={app.paths.desktop}")
print(f"app.paths.pictures={app.paths.pictures}")


if __name__ == "__main__":
main()
3 changes: 3 additions & 0 deletions core/tests/testbed/simple/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ def main():
print(f"app.paths.cache={app.paths.cache.resolve()}")
print(f"app.paths.logs={app.paths.logs.resolve()}")
print(f"app.paths.toga={app.paths.toga.resolve()}")
print(f"app.paths.documents={app.paths.documents.resolve()}")
print(f"app.paths.desktop={app.paths.desktop.resolve()}")
print(f"app.paths.pictures={app.paths.pictures.resolve()}")


if __name__ == "__main__":
Expand Down
9 changes: 9 additions & 0 deletions dummy/src/toga_dummy/paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,12 @@ def get_cache_path(self):

def get_logs_path(self):
return Path.home() / "logs" / App.app.app_id

def get_documents_path(self):
return Path.home() / "Documents"

def get_pictures_path(self):
return Path.home() / "Pictures"

def get_desktop_path(self):
return Path.home() / "Desktop"
Loading