From 1dea074532a4dc8b8e594eefc65f9c726fea7da5 Mon Sep 17 00:00:00 2001 From: temitayoadefemi <111149469+temitayoadefemi@users.noreply.github.com> Date: Tue, 30 Jul 2024 16:17:01 +0100 Subject: [PATCH 1/7] Update storagepath.py --- plyer/platforms/ios/storagepath.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plyer/platforms/ios/storagepath.py b/plyer/platforms/ios/storagepath.py index cd8bbc39c..336bf9f1c 100644 --- a/plyer/platforms/ios/storagepath.py +++ b/plyer/platforms/ios/storagepath.py @@ -16,6 +16,7 @@ NSMoviesDirectory = 17 NSMusicDirectory = 18 NSPicturesDirectory = 19 +NSDesktopDirectory = 12 class iOSStoragePath(StoragePath): @@ -57,6 +58,11 @@ def _get_application_dir(self): NSApplicationDirectory, 1).firstObject().absoluteString.\ UTF8String() + def _get_desktop_dir(self): + return self.defaultManager.URLsForDirectory_inDomains_( + NSDesktopDirectory, 1).firstObject().absoluteString().\ + UTF8String() + def instance(): return iOSStoragePath() From 17a2ce17a7be3bd98aadc4a422209a63fde94519 Mon Sep 17 00:00:00 2001 From: temitayoadefemi <111149469+temitayoadefemi@users.noreply.github.com> Date: Tue, 30 Jul 2024 16:42:34 +0100 Subject: [PATCH 2/7] Update storagepath.py --- plyer/facades/storagepath.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/plyer/facades/storagepath.py b/plyer/facades/storagepath.py index 7445a5635..48195f535 100644 --- a/plyer/facades/storagepath.py +++ b/plyer/facades/storagepath.py @@ -27,9 +27,11 @@ >>> from plyer import storagepath >>> storagepath.get_application_dir() + ''' + class StoragePath: ''' StoragePath facade. @@ -101,7 +103,12 @@ def get_application_dir(self): Get the path of the directory holding application files. ''' return self._get_application_dir() - + + def get_desktop_dir(self): + ''' + Get the path of the directory holding application files. + ''' + return self._get_desktop_dir() # private def _get_home_dir(self): @@ -133,3 +140,6 @@ def _get_pictures_dir(self): def _get_application_dir(self): raise NotImplementedError() + + def _get_desktop_dir(self): + raise NotImplementedError() From 2e8d1f96819edb2ef260b0b977cb4a4342237783 Mon Sep 17 00:00:00 2001 From: temitayoadefemi <111149469+temitayoadefemi@users.noreply.github.com> Date: Tue, 30 Jul 2024 16:42:36 +0100 Subject: [PATCH 3/7] Update test_storagepath.py --- plyer/tests/test_storagepath.py | 1 + 1 file changed, 1 insertion(+) diff --git a/plyer/tests/test_storagepath.py b/plyer/tests/test_storagepath.py index 35b8139e2..8272fde46 100644 --- a/plyer/tests/test_storagepath.py +++ b/plyer/tests/test_storagepath.py @@ -41,6 +41,7 @@ def test_storagepath_macosx(self): self.assertIn(path_format, storagepath.get_music_dir()) self.assertIn(path_format, storagepath.get_pictures_dir()) self.assertIn(path_format, storagepath.get_application_dir()) + self.assertIn(path_format, storagepath.get_desktop_dir()) @PlatformTest('win') def test_storagepath_windows(self): From f26fd8fb4801dc570ea959e9b4876a08f3c7e6fb Mon Sep 17 00:00:00 2001 From: temitayoadefemi <111149469+temitayoadefemi@users.noreply.github.com> Date: Tue, 30 Jul 2024 16:57:32 +0100 Subject: [PATCH 4/7] Update storagepath.py --- plyer/facades/storagepath.py | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/plyer/facades/storagepath.py b/plyer/facades/storagepath.py index 48195f535..1bde261b1 100644 --- a/plyer/facades/storagepath.py +++ b/plyer/facades/storagepath.py @@ -103,13 +103,6 @@ def get_application_dir(self): Get the path of the directory holding application files. ''' return self._get_application_dir() - - def get_desktop_dir(self): - ''' - Get the path of the directory holding application files. - ''' - return self._get_desktop_dir() - # private def _get_home_dir(self): raise NotImplementedError() @@ -140,6 +133,4 @@ def _get_pictures_dir(self): def _get_application_dir(self): raise NotImplementedError() - - def _get_desktop_dir(self): - raise NotImplementedError() + From a1c463a9e28742c990a3dafad74c146ef2dc5cf2 Mon Sep 17 00:00:00 2001 From: temitayoadefemi <111149469+temitayoadefemi@users.noreply.github.com> Date: Tue, 30 Jul 2024 16:57:34 +0100 Subject: [PATCH 5/7] Update storagepath.py --- plyer/platforms/ios/storagepath.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/plyer/platforms/ios/storagepath.py b/plyer/platforms/ios/storagepath.py index 336bf9f1c..41d6b8e2c 100644 --- a/plyer/platforms/ios/storagepath.py +++ b/plyer/platforms/ios/storagepath.py @@ -16,7 +16,6 @@ NSMoviesDirectory = 17 NSMusicDirectory = 18 NSPicturesDirectory = 19 -NSDesktopDirectory = 12 class iOSStoragePath(StoragePath): @@ -58,10 +57,6 @@ def _get_application_dir(self): NSApplicationDirectory, 1).firstObject().absoluteString.\ UTF8String() - def _get_desktop_dir(self): - return self.defaultManager.URLsForDirectory_inDomains_( - NSDesktopDirectory, 1).firstObject().absoluteString().\ - UTF8String() def instance(): From 7ced56d57c3b7ccb26eb62c77489b2f3f4722eda Mon Sep 17 00:00:00 2001 From: temitayoadefemi <111149469+temitayoadefemi@users.noreply.github.com> Date: Tue, 30 Jul 2024 16:57:36 +0100 Subject: [PATCH 6/7] Update storagepath.py --- plyer/platforms/macosx/storagepath.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/plyer/platforms/macosx/storagepath.py b/plyer/platforms/macosx/storagepath.py index 027b04ee7..9714a4698 100644 --- a/plyer/platforms/macosx/storagepath.py +++ b/plyer/platforms/macosx/storagepath.py @@ -15,6 +15,8 @@ NSMoviesDirectory = 17 NSMusicDirectory = 18 NSPicturesDirectory = 19 +NSDesktopDirectory = 12 + class OSXStoragePath(StoragePath): @@ -57,6 +59,14 @@ def _get_application_dir(self): NSApplicationDirectory, 1 ).firstObject().absoluteString.UTF8String() + def _get_desktop_dir(self): + return self.defaultManager.URLsForDirectory_inDomains_( + NSDesktopDirectory, 1).firstObject().absoluteString.\ + UTF8String() + + + + def instance(): return OSXStoragePath() From 98ed208873206b28b24cdcd40398634d569bb26b Mon Sep 17 00:00:00 2001 From: temitayoadefemi <111149469+temitayoadefemi@users.noreply.github.com> Date: Tue, 30 Jul 2024 17:50:07 +0100 Subject: [PATCH 7/7] Update storagepath.py --- plyer/facades/storagepath.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/plyer/facades/storagepath.py b/plyer/facades/storagepath.py index 1bde261b1..ad961f628 100644 --- a/plyer/facades/storagepath.py +++ b/plyer/facades/storagepath.py @@ -103,10 +103,17 @@ def get_application_dir(self): Get the path of the directory holding application files. ''' return self._get_application_dir() + + def get_desktop_dir(self): + ''' + Get the path of the directory holding application files. + ''' + return self._get_desktop_dir() + def _get_home_dir(self): raise NotImplementedError() - + def _get_external_storage_dir(self): raise NotImplementedError() @@ -134,3 +141,5 @@ def _get_pictures_dir(self): def _get_application_dir(self): raise NotImplementedError() + def _get_desktop_dir(self): + raise NotImplementedError() \ No newline at end of file