ThirdParty/Send2Trash/send2trash/plat_gio.py

changeset 3644
a2c88b9b1d16
child 4555
861e1741985c
equal deleted inserted replaced
3642:1a6f8d9b63a5 3644:a2c88b9b1d16
1 # Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
2
3 # This software is licensed under the "BSD" License as described in the "LICENSE" file,
4 # which should be included with this package. The terms are also available at
5 # http://www.hardcoded.net/licenses/bsd_license
6
7 from gi.repository import GObject, Gio
8
9 def send2trash(path):
10 try:
11 f = Gio.File.new_for_path(path)
12 f.trash(cancellable=None)
13 except GObject.GError as e:
14 raise OSError(e.message)

eric ide

mercurial