In the case where os.path.ismount() does not detect a mount and os.rename errors
fallback to HOMETRASH. This covers several situations where continuing with
the identified trash location is incorrect due to complex mounts.
Close#26, #41, #63.
The trash info file needs to exist before the file is moved into the trash folder.
This is to conform to the events based detection of trashed files in gnome and other file managers.
* Initial IFileOperation for Windows
- Try using IFileOperation instead of SHFileOperation
- Use pywin32 to accomplish this
- Implement fallback when pywin32 not available
- Handles paths like `C:\` just fine bu the `\\?\` paths in the test
cause issue
- Add batching for IFileOperation version (performance)
- Minor formatting applied by editor
* Fix issue with paths starting with \\?\
- Strip these characters off if present just like old implementation
* Add windows version check, legacy list support
- Add check for windows version for IFileOperation
- Add list support to legacy version
- Remove some debugging code
- Fix bug in path converson
Not sure if there is a better way to layout this file
* Split plat_win into legacy and modern
* Update other platforms for list support
Formatter also ran on these so some other minor changes.
* Add unit tests for multi-file calls
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.