mirror of
https://github.com/arsenetar/send2trash.git
synced 2024-12-21 10:59:03 +00:00
plat_other tries to see if an Ubuntu-style trash exists and uses it.
This commit is contained in:
parent
6856e49f2d
commit
cc15b628a2
@ -2,8 +2,21 @@ from __future__ import unicode_literals
|
||||
import sys
|
||||
import os
|
||||
import os.path as op
|
||||
import logging
|
||||
|
||||
TRASH_PATH = op.expanduser('~/.Trash')
|
||||
CANDIDATES = [
|
||||
'~/.local/share/Trash/files',
|
||||
'~/.Trash',
|
||||
]
|
||||
|
||||
for candidate in CANDIDATES:
|
||||
candidate_path = op.expanduser(candidate)
|
||||
if op.exists(candidate_path):
|
||||
TRASH_PATH = candidate_path
|
||||
break
|
||||
else:
|
||||
logging.warning("Can't find path for Trash")
|
||||
TRASH_PATH = op.expanduser('~/.Trash')
|
||||
|
||||
# XXX Make this work on external volumes
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user