mirror of
https://github.com/arsenetar/send2trash.git
synced 2025-05-08 09:49:52 +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,7 +2,20 @@ from __future__ import unicode_literals
|
|||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
import os.path as op
|
import os.path as op
|
||||||
|
import logging
|
||||||
|
|
||||||
|
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')
|
TRASH_PATH = op.expanduser('~/.Trash')
|
||||||
|
|
||||||
# XXX Make this work on external volumes
|
# XXX Make this work on external volumes
|
||||||
|
Loading…
x
Reference in New Issue
Block a user