1
0
mirror of https://github.com/arsenetar/send2trash.git synced 2024-12-08 21:49:03 +00:00
Commit Graph

34 Commits

Author SHA1 Message Date
Matthew D. Scholefield
9ede898c3e
Create __main__.py (Fixes #15) (#38)
This adds a main method that mimics the behavior of `rm`. It can be called via `python -m send2trash somefile`.
2020-05-27 07:52:00 -04:00
sharkykh
66afce7252 Fix silently failing on Windows (#33)
* Fix #31: Silently failing on Windows

* Update Windows test

* Fix test folders not getting removed
2019-04-30 12:28:09 -04:00
Thomas Kluyver
1dded4f572 Raise TrashPermissionError from gio backend (#22) 2018-02-16 09:30:26 -05:00
Mickaël Schoentgen
020d05979d Windows: Workaround for long paths (#23)
By using the short path version of a file, we can
manage to move long paths to the trash.

Limitations:
1/ If the final short path is longer than what
    `SHFileOperationW` can handle, it will fail
2/ Still not able to trash long path from another
    drive, ie: trying to delete C:\temp\foo.txt
    while the script is running from D:\trash.py
2018-02-16 09:07:05 -05:00
Thomas Kluyver
6b0bd46036 Define TrashPermissionError (#21) 2018-02-06 17:28:47 -05:00
5733670fc2 Workaround embedded null character (#18)
Workaround embedded null characters in strings.  This fixes 17.
2017-11-01 08:28:22 -04:00
Virgil Dupras
3071684f73 Fix newly-introduced crash under Windows
ref #14
2017-08-07 22:51:37 -04:00
Virgil Dupras
016b90c1ac Update copyright 2017-08-03 20:52:19 -04:00
Virgil Dupras
f324ff491e Properly reuse the "compat" unit 2017-08-03 20:47:58 -04:00
Thomas Kluyver
7fece243d8 Use bytes throughout plat_other 2017-08-01 12:26:09 +01:00
Kfir Hadas
f6f63b1796 Use text_type (unicode for PY2, str for PY3) (#12) 2017-07-07 16:09:16 -04:00
Julian David Rath
6c01453fd3 throwing a WindowsError with the code 2016-04-12 08:53:04 +02:00
Elan Ruusamäe
72bc94b48d Update plat_other.py
minor typo fix
2016-04-10 11:09:46 +03:00
Virgil Dupras
baf125ff61 Added support for Gnome's gio
Instead of using our own Freedesktop's trash implementation,
use gio when it's available.
2013-07-19 19:16:11 -04:00
Virgil Dupras
bb8ed834da Add same-codebase support for python 2.7.
When I opted for two codebases for python2/python3,
Send2Trash used C modules and it was easier to just have two
packages. With the ctypes version, supporting both python
versions becomes trivial and it's much more convenient to
merge them back into a single codebase.

I've only tested this code on Linux. I've converted plat_osx and
plat_win, but they only work theoretically.
2013-07-19 18:42:32 -04:00
gbn
aee2b7a8af Check access and devices before attempting trash. 2011-03-13 14:40:52 -04:00
gbn
d090156c45 Use realpath to find mountpoint 2011-03-13 14:38:03 -04:00
Virgil Dupras
358b705cbc Made a few minor style fixes, and added a proper error in cases where the target path of send2trash() doesn't exist. 2011-03-12 11:48:19 +01:00
gbn
eedbe258cb URL Escape the Path in trashinfo 2011-03-10 14:56:19 -05:00
gbn
18e3187c2f Replace == None with is None 2011-03-10 12:22:21 -05:00
gbn
8001be8f37 Remove import * 2011-03-10 12:21:05 -05:00
gbn
13b3943c82 Replace plat_other with one supporting the XDG Trash spec
Added tests for plat_other
2011-03-10 04:55:46 -05:00
Virgil Dupras
899a3efeb3 Converted the compiled win module to ctypes.
--HG--
branch : py3k
2010-10-17 18:00:56 +01:00
Virgil Dupras
a6907d57a9 Converted the compiled osx module to ctypes.
--HG--
branch : py3k
2010-10-17 18:28:28 +02:00
Virgil Dupras
02dc392c45 Fixed a bug in plat_other where conflict handling wouldn't be done correctly in external volume. Thanks to John Benediktsson for the tip.
--HG--
branch : py3k
extra : transplant_source : %C6%11%009sx%B29%CF%EC%CC%D4%88r%BE%D8%BB%9AIa
2010-07-09 21:49:46 -07:00
Virgil Dupras
7546aa606a Fixed an infinite loop in plat_other when using a relative path in a mounted directory.
--HG--
branch : py3k
extra : transplant_source : %B4%A2%DB%EFn%BB%3A%F6%AE%06%F3%29%DB%06%FBE%D0%A2%BEt
2010-07-09 21:46:19 -07:00
Virgil Dupras
2858b5b153 Converted to py3k (haven't tried it on Windows yet, but it should compile and work...)
--HG--
branch : py3k
2010-07-07 16:12:13 +02:00
Virgil Dupras
f5f9c5b352 Fixed the copyright comment which was at a strange place. 2010-04-21 10:30:51 +02:00
Virgil Dupras
203973d66c Licensed under BSD. 2010-04-07 08:52:24 +02:00
Virgil Dupras
ae126c47bf In plat_other, added support for sending to trash on external volumes. 2010-04-06 19:54:10 +02:00
Virgil Dupras
cc15b628a2 plat_other tries to see if an Ubuntu-style trash exists and uses it. 2010-04-06 19:11:37 +02:00
Virgil Dupras
6856e49f2d Added the plat_other module (for Linux). 2010-04-06 18:55:30 +02:00
Virgil Dupras
8a1dff2947 Renamed _trash_* modules to _send2trash_* and added python wrapper around them.
--HG--
rename : modules/trash_osx.c => modules/send2trash_osx.c
rename : modules/trash_win.c => modules/send2trash_win.c
2010-04-06 18:04:32 +02:00
Virgil Dupras
5aa4811725 Added the osx module. 2010-04-06 08:58:56 +02:00