Send2Trash 2.0.0__tar.gz → 2.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. {send2trash-2.0.0 → send2trash-2.2.0}/CHANGES.rst +133 -119
  2. {send2trash-2.0.0 → send2trash-2.2.0}/LICENSE +10 -10
  3. send2trash-2.2.0/MANIFEST.in +1 -0
  4. {send2trash-2.0.0/Send2Trash.egg-info → send2trash-2.2.0}/PKG-INFO +104 -106
  5. {send2trash-2.0.0 → send2trash-2.2.0}/README.rst +70 -70
  6. {send2trash-2.0.0 → send2trash-2.2.0/Send2Trash.egg-info}/PKG-INFO +104 -106
  7. {send2trash-2.0.0 → send2trash-2.2.0}/Send2Trash.egg-info/SOURCES.txt +4 -2
  8. send2trash-2.2.0/Send2Trash.egg-info/requires.txt +11 -0
  9. send2trash-2.2.0/pyproject.toml +55 -0
  10. {send2trash-2.0.0 → send2trash-2.2.0}/send2trash/__init__.py +24 -24
  11. {send2trash-2.0.0 → send2trash-2.2.0}/send2trash/__main__.py +33 -36
  12. {send2trash-2.0.0 → send2trash-2.2.0}/send2trash/exceptions.py +20 -20
  13. {send2trash-2.0.0 → send2trash-2.2.0}/send2trash/mac/__init__.py +21 -20
  14. {send2trash-2.0.0 → send2trash-2.2.0}/send2trash/mac/legacy.py +51 -52
  15. {send2trash-2.0.0 → send2trash-2.2.0}/send2trash/mac/modern.py +25 -25
  16. {send2trash-2.0.0 → send2trash-2.2.0}/send2trash/plat_gio.py +23 -23
  17. {send2trash-2.0.0 → send2trash-2.2.0}/send2trash/plat_other.py +198 -196
  18. {send2trash-2.0.0 → send2trash-2.2.0}/send2trash/util.py +17 -18
  19. {send2trash-2.0.0 → send2trash-2.2.0}/send2trash/win/IFileOperationProgressSink.py +46 -46
  20. {send2trash-2.0.0 → send2trash-2.2.0}/send2trash/win/__init__.py +19 -20
  21. {send2trash-2.0.0 → send2trash-2.2.0}/send2trash/win/legacy.py +183 -181
  22. {send2trash-2.0.0 → send2trash-2.2.0}/send2trash/win/modern.py +64 -65
  23. send2trash-2.2.0/setup.cfg +4 -0
  24. send2trash-2.2.0/tests/conftest.py +26 -0
  25. send2trash-2.2.0/tests/test_plat_mac.py +45 -0
  26. {send2trash-2.0.0 → send2trash-2.2.0}/tests/test_plat_other.py +326 -210
  27. {send2trash-2.0.0 → send2trash-2.2.0}/tests/test_plat_win.py +214 -215
  28. {send2trash-2.0.0 → send2trash-2.2.0}/tests/test_script_main.py +15 -16
  29. send2trash-2.2.0/tests/test_win_legacy_diagnostics.py +24 -0
  30. send2trash-2.0.0/MANIFEST.in +0 -1
  31. send2trash-2.0.0/Send2Trash.egg-info/requires.txt +0 -18
  32. send2trash-2.0.0/pyproject.toml +0 -6
  33. send2trash-2.0.0/setup.cfg +0 -56
  34. {send2trash-2.0.0 → send2trash-2.2.0}/Send2Trash.egg-info/dependency_links.txt +0 -0
  35. {send2trash-2.0.0 → send2trash-2.2.0}/Send2Trash.egg-info/entry_points.txt +0 -0
  36. {send2trash-2.0.0 → send2trash-2.2.0}/Send2Trash.egg-info/top_level.txt +0 -0
@@ -1,119 +1,133 @@
1
- Changes
2
- =======
3
- Version 2.0.0 -- 2025/12/30
4
- ---------------------------
5
- * Drop suport for Python 2
6
- * Fix `test_trash_topdir` failing on macOS by @denini08 in https://github.com/arsenetar/send2trash/pull/100
7
- * Update source installation instructions by @gunSlaveUnit in https://github.com/arsenetar/send2trash/pull/102
8
- * Update gio implemenation, should fix #5 by no longer using deprecated GObject.GError
9
-
10
- Version 1.8.3 -- 2024/04/06
11
- ---------------------------
12
- * Add support for any iterable type as input by @PalmtopTiger in https://github.com/arsenetar/send2trash/pull/88
13
- * fix: Use os.fsdecode() for arguments to shutil.move() by @yogeshiitm in https://github.com/arsenetar/send2trash/pull/90
14
-
15
- Version 1.8.2 -- 2023/04/27
16
- ---------------------------
17
- * win/legacy: tiny logic simplification by @BoboTiG in https://github.com/arsenetar/send2trash/pull/77
18
- * TravisCI is not used anymore by @sobolevn in https://github.com/arsenetar/send2trash/pull/73
19
- * fix(ci): Update to latest actions, fix python versions by @arsenetar in https://github.com/arsenetar/send2trash/pull/78
20
-
21
- Version 1.8.1b0 -- 2021/09/20
22
- -----------------------------
23
- * Add fallback to HOMETRASH when cross device errors happen in plat_other (#26, #41, #63)
24
-
25
- Version 1.8.0 -- 2021/08/08
26
- ---------------------------
27
-
28
- * Add compatibility with pathlib paths (#49)
29
- * Fix thread compatibility of modern windows implementation (#59)
30
- * Fix handling of UNC names in legacy windows implementation (#57)
31
-
32
- Version 1.7.1 -- 2021/06/21
33
- ---------------------------
34
-
35
- * Release stable version with changes from last 3 releases
36
- * Fix handling of UNC names (#57)
37
-
38
- Version 1.7.0a1 -- 2021/05/14
39
- -----------------------------
40
-
41
- * Changed conditional for when to try to use pyobjc version (#51)
42
-
43
- Version 1.7.0a0 -- 2021/04/20
44
- -----------------------------
45
-
46
- * Add console_script entry point (#50)
47
- * Increased python CI versions (#52, #54)
48
- * Fix minor issue in setup.py (#53)
49
- * Fix issue with windows tests importing modules on non-windows (#55)
50
- * Unit test cleanups, rewrites, and flake8 cleanups
51
- * Windows: Fix legacy windows platform for multi-byte unicode and add tests
52
- * macOS: Add alternative pyobjc version to potentially improve compatibility (#51)
53
-
54
- Version 1.6.0b1 -- 2020/06/18
55
- -----------------------------
56
-
57
- * Add main method which allows calling via ``python -m send2trash somefile``
58
- * Windows: Add support for using IFileOperation when pywin32 is present on Vista and newer
59
- * Add support for passing multiple files at once in a list
60
- * Windows: Batch multi-file calls to improve performance (#42)
61
- * Windows: Fix issue with SHFileOperation failing silently when path is not found (#33)
62
-
63
- Version 1.5.0 -- 2018/02/16
64
- ---------------------------
65
-
66
- * More specific error when failing to create XDG fallback trash directory (#20)
67
- * Windows: Workaround for long paths (#23)
68
-
69
- Version 1.4.2 -- 2017/11/17
70
- ---------------------------
71
-
72
- * Fix incompatibility with Python 3.6 on Windows. (#18)
73
-
74
- Version 1.4.1 -- 2017/08/07
75
- ---------------------------
76
-
77
- * Fix crash on Windows introduced in v1.4.0. Oops... (#14)
78
-
79
- Version 1.4.0 -- 2017/08/07
80
- ---------------------------
81
-
82
- * Use ``bytes`` instead of ``str`` for internal path handling in ``plat_other``. (#13)
83
-
84
- Version 1.3.1 -- 2017/07/31
85
- ---------------------------
86
-
87
- * Throw ``WindowsError`` instead of ``OSError`` in ``plat_win``. (#7)
88
- * Fix ``TypeError`` on python 2 in ``plat_other``. (#12)
89
-
90
- Version 1.3.0 -- 2013/07/19
91
- ---------------------------
92
-
93
- * Added support for Gnome's GIO.
94
- * Merged Python 3 and Python 2 versions in a single codebase.
95
-
96
- Version 1.2.0 -- 2011/03/16
97
- ---------------------------
98
-
99
- * Improved ``plat_other`` to follow freedesktop.org trash specification.
100
-
101
- Version 1.1.0 -- 2010/10/18
102
- ---------------------------
103
-
104
- * Converted compiled modules to ctypes so that cross-platform compilation isn't necessary anymore.
105
-
106
- Version 1.0.2 -- 2010/07/10
107
- ---------------------------
108
-
109
- * Fixed bugs with external volumes in plat_other.
110
-
111
- Version 1.0.1 -- 2010/04/19
112
- ---------------------------
113
-
114
- * Fixed memory leak in OS X module.
115
-
116
- Version 1.0.0 -- 2010/04/07
117
- ---------------------------
118
-
119
- * Initial Release
1
+ Changes
2
+ =======
3
+ Version 2.2.0 -- 2026/11/11
4
+ ---------------------------
5
+ * Resolve path validation flaw (https://github.com/arsenetar/send2trash/security/advisories/GHSA-fgv9-r74r-hqmx) in 522bafe
6
+ * python2 removal: more clean up by @caspian-yez in https://github.com/arsenetar/send2trash/pull/107
7
+ * Handle unavailable macOS version during backend selection by @Neallin-917 in https://github.com/arsenetar/send2trash/pull/114
8
+ * Improve legacy Windows error diagnostics by @dajiaohuang in https://github.com/arsenetar/send2trash/pull/120
9
+ * Resolve symlink homes when choosing the trash device by @ac1982 in https://github.com/arsenetar/send2trash/pull/117
10
+
11
+ Version 2.1.0 -- 2026/01/14
12
+ ---------------------------
13
+ * Add `conftest.py` to source distribution by @mgorny in https://github.com/arsenetar/send2trash/pull/106
14
+ * Replacing elif, which is always True, with else by @PalmtopTiger in https://github.com/arsenetar/send2trash/pull/104
15
+ * Migrate to pyproject.toml from setup.cfg
16
+
17
+ Version 2.0.0 -- 2025/12/30
18
+ ---------------------------
19
+ * Drop suport for Python 2
20
+ * Fix `test_trash_topdir` failing on macOS by @denini08 in https://github.com/arsenetar/send2trash/pull/100
21
+ * Update source installation instructions by @gunSlaveUnit in https://github.com/arsenetar/send2trash/pull/102
22
+ * Update gio implemenation, should fix #5 by no longer using deprecated GObject.GError
23
+
24
+ Version 1.8.3 -- 2024/04/06
25
+ ---------------------------
26
+ * Add support for any iterable type as input by @PalmtopTiger in https://github.com/arsenetar/send2trash/pull/88
27
+ * fix: Use os.fsdecode() for arguments to shutil.move() by @yogeshiitm in https://github.com/arsenetar/send2trash/pull/90
28
+
29
+ Version 1.8.2 -- 2023/04/27
30
+ ---------------------------
31
+ * win/legacy: tiny logic simplification by @BoboTiG in https://github.com/arsenetar/send2trash/pull/77
32
+ * TravisCI is not used anymore by @sobolevn in https://github.com/arsenetar/send2trash/pull/73
33
+ * fix(ci): Update to latest actions, fix python versions by @arsenetar in https://github.com/arsenetar/send2trash/pull/78
34
+
35
+ Version 1.8.1b0 -- 2021/09/20
36
+ -----------------------------
37
+ * Add fallback to HOMETRASH when cross device errors happen in plat_other (#26, #41, #63)
38
+
39
+ Version 1.8.0 -- 2021/08/08
40
+ ---------------------------
41
+
42
+ * Add compatibility with pathlib paths (#49)
43
+ * Fix thread compatibility of modern windows implementation (#59)
44
+ * Fix handling of UNC names in legacy windows implementation (#57)
45
+
46
+ Version 1.7.1 -- 2021/06/21
47
+ ---------------------------
48
+
49
+ * Release stable version with changes from last 3 releases
50
+ * Fix handling of UNC names (#57)
51
+
52
+ Version 1.7.0a1 -- 2021/05/14
53
+ -----------------------------
54
+
55
+ * Changed conditional for when to try to use pyobjc version (#51)
56
+
57
+ Version 1.7.0a0 -- 2021/04/20
58
+ -----------------------------
59
+
60
+ * Add console_script entry point (#50)
61
+ * Increased python CI versions (#52, #54)
62
+ * Fix minor issue in setup.py (#53)
63
+ * Fix issue with windows tests importing modules on non-windows (#55)
64
+ * Unit test cleanups, rewrites, and flake8 cleanups
65
+ * Windows: Fix legacy windows platform for multi-byte unicode and add tests
66
+ * macOS: Add alternative pyobjc version to potentially improve compatibility (#51)
67
+
68
+ Version 1.6.0b1 -- 2020/06/18
69
+ -----------------------------
70
+
71
+ * Add main method which allows calling via ``python -m send2trash somefile``
72
+ * Windows: Add support for using IFileOperation when pywin32 is present on Vista and newer
73
+ * Add support for passing multiple files at once in a list
74
+ * Windows: Batch multi-file calls to improve performance (#42)
75
+ * Windows: Fix issue with SHFileOperation failing silently when path is not found (#33)
76
+
77
+ Version 1.5.0 -- 2018/02/16
78
+ ---------------------------
79
+
80
+ * More specific error when failing to create XDG fallback trash directory (#20)
81
+ * Windows: Workaround for long paths (#23)
82
+
83
+ Version 1.4.2 -- 2017/11/17
84
+ ---------------------------
85
+
86
+ * Fix incompatibility with Python 3.6 on Windows. (#18)
87
+
88
+ Version 1.4.1 -- 2017/08/07
89
+ ---------------------------
90
+
91
+ * Fix crash on Windows introduced in v1.4.0. Oops... (#14)
92
+
93
+ Version 1.4.0 -- 2017/08/07
94
+ ---------------------------
95
+
96
+ * Use ``bytes`` instead of ``str`` for internal path handling in ``plat_other``. (#13)
97
+
98
+ Version 1.3.1 -- 2017/07/31
99
+ ---------------------------
100
+
101
+ * Throw ``WindowsError`` instead of ``OSError`` in ``plat_win``. (#7)
102
+ * Fix ``TypeError`` on python 2 in ``plat_other``. (#12)
103
+
104
+ Version 1.3.0 -- 2013/07/19
105
+ ---------------------------
106
+
107
+ * Added support for Gnome's GIO.
108
+ * Merged Python 3 and Python 2 versions in a single codebase.
109
+
110
+ Version 1.2.0 -- 2011/03/16
111
+ ---------------------------
112
+
113
+ * Improved ``plat_other`` to follow freedesktop.org trash specification.
114
+
115
+ Version 1.1.0 -- 2010/10/18
116
+ ---------------------------
117
+
118
+ * Converted compiled modules to ctypes so that cross-platform compilation isn't necessary anymore.
119
+
120
+ Version 1.0.2 -- 2010/07/10
121
+ ---------------------------
122
+
123
+ * Fixed bugs with external volumes in plat_other.
124
+
125
+ Version 1.0.1 -- 2010/04/19
126
+ ---------------------------
127
+
128
+ * Fixed memory leak in OS X module.
129
+
130
+ Version 1.0.0 -- 2010/04/07
131
+ ---------------------------
132
+
133
+ * Initial Release
@@ -1,10 +1,10 @@
1
- Copyright (c) 2017, Virgil Dupras
2
- All rights reserved.
3
-
4
- Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
5
-
6
- * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
7
- * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
8
- * Neither the name of Hardcoded Software Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
9
-
10
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1
+ Copyright (c) 2017, Virgil Dupras
2
+ All rights reserved.
3
+
4
+ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
5
+
6
+ * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
7
+ * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
8
+ * Neither the name of Hardcoded Software Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
9
+
10
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1 @@
1
+ include CHANGES.rst LICENSE tests/conftest.py
@@ -1,106 +1,104 @@
1
- Metadata-Version: 2.4
2
- Name: Send2Trash
3
- Version: 2.0.0
4
- Summary: Send file to trash natively under Mac OS X, Windows and Linux
5
- Home-page: https://github.com/arsenetar/send2trash
6
- Author: Andrew Senetar
7
- Author-email: arsenetar@voltaicideas.net
8
- License: BSD License
9
- Project-URL: Bug Reports, https://github.com/arsenetar/send2trash/issues
10
- Classifier: Development Status :: 5 - Production/Stable
11
- Classifier: Intended Audience :: Developers
12
- Classifier: License :: OSI Approved :: BSD License
13
- Classifier: Operating System :: MacOS :: MacOS X
14
- Classifier: Operating System :: Microsoft :: Windows
15
- Classifier: Operating System :: POSIX
16
- Classifier: Programming Language :: Python :: 3
17
- Classifier: Programming Language :: Python :: 3.8
18
- Classifier: Programming Language :: Python :: 3.9
19
- Classifier: Programming Language :: Python :: 3.10
20
- Classifier: Programming Language :: Python :: 3.11
21
- Classifier: Programming Language :: Python :: 3.12
22
- Classifier: Programming Language :: Python :: 3.13
23
- Classifier: Programming Language :: Python :: 3.14
24
- Classifier: Topic :: Desktop Environment :: File Managers
25
- Requires-Python: !=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,!=3.7.*
26
- Description-Content-Type: text/x-rst
27
- License-File: LICENSE
28
- Provides-Extra: win32
29
- Requires-Dist: pywin32; sys_platform == "win32" and extra == "win32"
30
- Provides-Extra: objc
31
- Requires-Dist: pyobjc-framework-Cocoa; sys_platform == "darwin" and extra == "objc"
32
- Provides-Extra: nativelib
33
- Requires-Dist: pywin32; sys_platform == "win32" and extra == "nativelib"
34
- Requires-Dist: pyobjc-framework-Cocoa; sys_platform == "darwin" and extra == "nativelib"
35
- Dynamic: license-file
36
-
37
- ==================================================
38
- Send2Trash -- Send files to trash on all platforms
39
- ==================================================
40
-
41
- Send2Trash is a small package that sends files to the Trash (or Recycle Bin) *natively* and on
42
- *all platforms*. On OS X, it uses native ``FSMoveObjectToTrashSync`` Cocoa calls or can use pyobjc
43
- with NSFileManager. On Windows, it uses native ``IFileOperation`` call if on Vista or newer and
44
- pywin32 is installed or falls back to ``SHFileOperation`` calls. On other platforms, if `PyGObject`_
45
- and `GIO`_ are available, it will use this. Otherwise, it will fallback to its own implementation of
46
- the `trash specifications from freedesktop.org`_.
47
-
48
- ``ctypes`` is used to access native libraries, so no compilation is necessary.
49
-
50
- Send2Trash supports Python 3 (versions before 2.x support Python 2).
51
-
52
- Status: Additional Help Welcome
53
- -------------------------------
54
-
55
- Additional help is welcome for supporting this package. Specifically help with the OSX and Linux
56
- issues and fixes would be most appreciated.
57
-
58
- Installation
59
- ------------
60
-
61
- You can download it with pip:
62
-
63
- python -m pip install -U send2trash
64
-
65
- To install with pywin32 or pyobjc required specify the extra `nativeLib`:
66
-
67
- python -m pip install -U send2trash[nativeLib]
68
-
69
- or download the source from https://github.com/arsenetar/send2trash and install it with:
70
-
71
- python -m pip install -e .
72
-
73
- On systems where Python enforces PEP 668 (e.g., recent Linux distributions),
74
- installing packages into the system Python may be restricted.
75
- Use a virtual environment:
76
-
77
- python -m venv .venv
78
-
79
- GNU/Linux / macOS:
80
-
81
- source .venv/bin/activate
82
-
83
- Windows:
84
-
85
- .venv\Scripts\activate
86
-
87
- Usage
88
- -----
89
-
90
- >>> from send2trash import send2trash
91
- >>> send2trash('some_file')
92
- >>> send2trash(['some_file1', 'some_file2'])
93
-
94
- On Freedesktop platforms (Linux, BSD, etc.), you may not be able to efficiently
95
- trash some files. In these cases, an exception ``send2trash.TrashPermissionError``
96
- is raised, so that the application can handle this case. This inherits from
97
- ``PermissionError``. Specifically, this affects
98
- files on a different device to the user's home directory, where the root of the
99
- device does not have a ``.Trash`` directory, and we don't have permission to
100
- create a ``.Trash-$UID`` directory.
101
-
102
- For any other problem, ``OSError`` is raised.
103
-
104
- .. _PyGObject: https://wiki.gnome.org/PyGObject
105
- .. _GIO: https://developer.gnome.org/gio/
106
- .. _trash specifications from freedesktop.org: http://freedesktop.org/wiki/Specifications/trash-spec/
1
+ Metadata-Version: 2.4
2
+ Name: Send2Trash
3
+ Version: 2.2.0
4
+ Summary: Send file to trash natively under Mac OS X, Windows and Linux
5
+ Author-email: Andrew Senetar <arsenetar@voltaicideas.net>
6
+ License-Expression: BSD-3-Clause
7
+ Project-URL: Homepage, https://github.com/arsenetar/send2trash
8
+ Project-URL: Repository, https://github.com/arsenetar/send2trash.git
9
+ Project-URL: Issues, https://github.com/arsenetar/send2trash/issues
10
+ Classifier: Development Status :: 5 - Production/Stable
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: Operating System :: MacOS :: MacOS X
13
+ Classifier: Operating System :: Microsoft :: Windows
14
+ Classifier: Operating System :: POSIX
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.8
17
+ Classifier: Programming Language :: Python :: 3.9
18
+ Classifier: Programming Language :: Python :: 3.10
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Programming Language :: Python :: 3.13
22
+ Classifier: Programming Language :: Python :: 3.14
23
+ Classifier: Programming Language :: Python :: 3.15
24
+ Classifier: Topic :: Desktop Environment :: File Managers
25
+ Requires-Python: >=3.8
26
+ Description-Content-Type: text/x-rst
27
+ License-File: LICENSE
28
+ Provides-Extra: test
29
+ Requires-Dist: pytest>=8; extra == "test"
30
+ Provides-Extra: nativelib
31
+ Requires-Dist: pywin32>=305; sys_platform == "win32" and extra == "nativelib"
32
+ Requires-Dist: pyobjc>=9.0; sys_platform == "darwin" and extra == "nativelib"
33
+ Dynamic: license-file
34
+
35
+ ==================================================
36
+ Send2Trash -- Send files to trash on all platforms
37
+ ==================================================
38
+
39
+ Send2Trash is a small package that sends files to the Trash (or Recycle Bin) *natively* and on
40
+ *all platforms*. On OS X, it uses native ``FSMoveObjectToTrashSync`` Cocoa calls or can use pyobjc
41
+ with NSFileManager. On Windows, it uses native ``IFileOperation`` call if on Vista or newer and
42
+ pywin32 is installed or falls back to ``SHFileOperation`` calls. On other platforms, if `PyGObject`_
43
+ and `GIO`_ are available, it will use this. Otherwise, it will fallback to its own implementation of
44
+ the `trash specifications from freedesktop.org`_.
45
+
46
+ ``ctypes`` is used to access native libraries, so no compilation is necessary.
47
+
48
+ Send2Trash supports Python 3 (versions before 2.x support Python 2).
49
+
50
+ Status: Additional Help Welcome
51
+ -------------------------------
52
+
53
+ Additional help is welcome for supporting this package. Specifically help with the OSX and Linux
54
+ issues and fixes would be most appreciated.
55
+
56
+ Installation
57
+ ------------
58
+
59
+ You can download it with pip:
60
+
61
+ python -m pip install -U send2trash
62
+
63
+ To install with pywin32 or pyobjc required specify the extra `nativeLib`:
64
+
65
+ python -m pip install -U send2trash[nativeLib]
66
+
67
+ or download the source from https://github.com/arsenetar/send2trash and install it with:
68
+
69
+ python -m pip install -e .
70
+
71
+ On systems where Python enforces PEP 668 (e.g., recent Linux distributions),
72
+ installing packages into the system Python may be restricted.
73
+ Use a virtual environment:
74
+
75
+ python -m venv .venv
76
+
77
+ GNU/Linux / macOS:
78
+
79
+ source .venv/bin/activate
80
+
81
+ Windows:
82
+
83
+ .venv\Scripts\activate
84
+
85
+ Usage
86
+ -----
87
+
88
+ >>> from send2trash import send2trash
89
+ >>> send2trash('some_file')
90
+ >>> send2trash(['some_file1', 'some_file2'])
91
+
92
+ On Freedesktop platforms (Linux, BSD, etc.), you may not be able to efficiently
93
+ trash some files. In these cases, an exception ``send2trash.TrashPermissionError``
94
+ is raised, so that the application can handle this case. This inherits from
95
+ ``PermissionError``. Specifically, this affects
96
+ files on a different device to the user's home directory, where the root of the
97
+ device does not have a ``.Trash`` directory, and we don't have permission to
98
+ create a ``.Trash-$UID`` directory.
99
+
100
+ For any other problem, ``OSError`` is raised.
101
+
102
+ .. _PyGObject: https://wiki.gnome.org/PyGObject
103
+ .. _GIO: https://developer.gnome.org/gio/
104
+ .. _trash specifications from freedesktop.org: http://freedesktop.org/wiki/Specifications/trash-spec/
@@ -1,70 +1,70 @@
1
- ==================================================
2
- Send2Trash -- Send files to trash on all platforms
3
- ==================================================
4
-
5
- Send2Trash is a small package that sends files to the Trash (or Recycle Bin) *natively* and on
6
- *all platforms*. On OS X, it uses native ``FSMoveObjectToTrashSync`` Cocoa calls or can use pyobjc
7
- with NSFileManager. On Windows, it uses native ``IFileOperation`` call if on Vista or newer and
8
- pywin32 is installed or falls back to ``SHFileOperation`` calls. On other platforms, if `PyGObject`_
9
- and `GIO`_ are available, it will use this. Otherwise, it will fallback to its own implementation of
10
- the `trash specifications from freedesktop.org`_.
11
-
12
- ``ctypes`` is used to access native libraries, so no compilation is necessary.
13
-
14
- Send2Trash supports Python 3 (versions before 2.x support Python 2).
15
-
16
- Status: Additional Help Welcome
17
- -------------------------------
18
-
19
- Additional help is welcome for supporting this package. Specifically help with the OSX and Linux
20
- issues and fixes would be most appreciated.
21
-
22
- Installation
23
- ------------
24
-
25
- You can download it with pip:
26
-
27
- python -m pip install -U send2trash
28
-
29
- To install with pywin32 or pyobjc required specify the extra `nativeLib`:
30
-
31
- python -m pip install -U send2trash[nativeLib]
32
-
33
- or download the source from https://github.com/arsenetar/send2trash and install it with:
34
-
35
- python -m pip install -e .
36
-
37
- On systems where Python enforces PEP 668 (e.g., recent Linux distributions),
38
- installing packages into the system Python may be restricted.
39
- Use a virtual environment:
40
-
41
- python -m venv .venv
42
-
43
- GNU/Linux / macOS:
44
-
45
- source .venv/bin/activate
46
-
47
- Windows:
48
-
49
- .venv\Scripts\activate
50
-
51
- Usage
52
- -----
53
-
54
- >>> from send2trash import send2trash
55
- >>> send2trash('some_file')
56
- >>> send2trash(['some_file1', 'some_file2'])
57
-
58
- On Freedesktop platforms (Linux, BSD, etc.), you may not be able to efficiently
59
- trash some files. In these cases, an exception ``send2trash.TrashPermissionError``
60
- is raised, so that the application can handle this case. This inherits from
61
- ``PermissionError``. Specifically, this affects
62
- files on a different device to the user's home directory, where the root of the
63
- device does not have a ``.Trash`` directory, and we don't have permission to
64
- create a ``.Trash-$UID`` directory.
65
-
66
- For any other problem, ``OSError`` is raised.
67
-
68
- .. _PyGObject: https://wiki.gnome.org/PyGObject
69
- .. _GIO: https://developer.gnome.org/gio/
70
- .. _trash specifications from freedesktop.org: http://freedesktop.org/wiki/Specifications/trash-spec/
1
+ ==================================================
2
+ Send2Trash -- Send files to trash on all platforms
3
+ ==================================================
4
+
5
+ Send2Trash is a small package that sends files to the Trash (or Recycle Bin) *natively* and on
6
+ *all platforms*. On OS X, it uses native ``FSMoveObjectToTrashSync`` Cocoa calls or can use pyobjc
7
+ with NSFileManager. On Windows, it uses native ``IFileOperation`` call if on Vista or newer and
8
+ pywin32 is installed or falls back to ``SHFileOperation`` calls. On other platforms, if `PyGObject`_
9
+ and `GIO`_ are available, it will use this. Otherwise, it will fallback to its own implementation of
10
+ the `trash specifications from freedesktop.org`_.
11
+
12
+ ``ctypes`` is used to access native libraries, so no compilation is necessary.
13
+
14
+ Send2Trash supports Python 3 (versions before 2.x support Python 2).
15
+
16
+ Status: Additional Help Welcome
17
+ -------------------------------
18
+
19
+ Additional help is welcome for supporting this package. Specifically help with the OSX and Linux
20
+ issues and fixes would be most appreciated.
21
+
22
+ Installation
23
+ ------------
24
+
25
+ You can download it with pip:
26
+
27
+ python -m pip install -U send2trash
28
+
29
+ To install with pywin32 or pyobjc required specify the extra `nativeLib`:
30
+
31
+ python -m pip install -U send2trash[nativeLib]
32
+
33
+ or download the source from https://github.com/arsenetar/send2trash and install it with:
34
+
35
+ python -m pip install -e .
36
+
37
+ On systems where Python enforces PEP 668 (e.g., recent Linux distributions),
38
+ installing packages into the system Python may be restricted.
39
+ Use a virtual environment:
40
+
41
+ python -m venv .venv
42
+
43
+ GNU/Linux / macOS:
44
+
45
+ source .venv/bin/activate
46
+
47
+ Windows:
48
+
49
+ .venv\Scripts\activate
50
+
51
+ Usage
52
+ -----
53
+
54
+ >>> from send2trash import send2trash
55
+ >>> send2trash('some_file')
56
+ >>> send2trash(['some_file1', 'some_file2'])
57
+
58
+ On Freedesktop platforms (Linux, BSD, etc.), you may not be able to efficiently
59
+ trash some files. In these cases, an exception ``send2trash.TrashPermissionError``
60
+ is raised, so that the application can handle this case. This inherits from
61
+ ``PermissionError``. Specifically, this affects
62
+ files on a different device to the user's home directory, where the root of the
63
+ device does not have a ``.Trash`` directory, and we don't have permission to
64
+ create a ``.Trash-$UID`` directory.
65
+
66
+ For any other problem, ``OSError`` is raised.
67
+
68
+ .. _PyGObject: https://wiki.gnome.org/PyGObject
69
+ .. _GIO: https://developer.gnome.org/gio/
70
+ .. _trash specifications from freedesktop.org: http://freedesktop.org/wiki/Specifications/trash-spec/