mirror of
https://github.com/arsenetar/send2trash.git
synced 2026-03-16 20:31:37 +00:00
Add ability to handle pathlib paths
- Handle pathlib paths across all implementations, plat_other already did - Move preprocessing code to common location
This commit is contained in:
@@ -6,11 +6,11 @@
|
||||
|
||||
from gi.repository import GObject, Gio
|
||||
from .exceptions import TrashPermissionError
|
||||
from .util import preprocess_paths
|
||||
|
||||
|
||||
def send2trash(paths):
|
||||
if not isinstance(paths, list):
|
||||
paths = [paths]
|
||||
paths = preprocess_paths(paths)
|
||||
for path in paths:
|
||||
try:
|
||||
f = Gio.File.new_for_path(path)
|
||||
|
||||
Reference in New Issue
Block a user