Renamed _trash_* modules to _send2trash_* and added python wrapper around them.
--HG-- rename : modules/trash_osx.c => modules/send2trash_osx.c rename : modules/trash_win.c => modules/send2trash_win.cpull/6/head
parent
be87b55146
commit
8a1dff2947
@ -0,0 +1,8 @@
|
||||
import sys
|
||||
|
||||
if sys.platform == 'darwin':
|
||||
from plat_osx import send2trash
|
||||
elif sys.platform == 'win32':
|
||||
from plat_win import send2trash
|
||||
else:
|
||||
print "Unsupported platform"
|
@ -0,0 +1,6 @@
|
||||
import _send2trash_osx
|
||||
|
||||
def send2trash(path):
|
||||
if not isinstance(path, unicode):
|
||||
path = unicode(path, 'utf-8')
|
||||
_send2trash_osx.send(path)
|
@ -0,0 +1,9 @@
|
||||
import os.path as op
|
||||
import _send2trash_win
|
||||
|
||||
def send2trash(path):
|
||||
if not isinstance(path, unicode):
|
||||
path = unicode(path, 'mbcs')
|
||||
if not op.isabs(path):
|
||||
path = op.abspath(path)
|
||||
_send2trash_win.send(path)
|
Loading…
Reference in New Issue