From 2858b5b15343d2e2c559b8212beb1526c84fbb61 Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Wed, 7 Jul 2010 16:12:13 +0200 Subject: [PATCH 01/10] Converted to py3k (haven't tried it on Windows yet, but it should compile and work...) --HG-- branch : py3k --- modules/send2trash_osx.c | 21 +++++++++++++++++---- modules/send2trash_win.c | 21 +++++++++++++++++---- send2trash/__init__.py | 6 +++--- send2trash/plat_osx.py | 8 ++++---- send2trash/plat_other.py | 6 +++--- send2trash/plat_win.py | 8 ++++---- setup.py | 8 ++++---- 7 files changed, 52 insertions(+), 26 deletions(-) diff --git a/modules/send2trash_osx.c b/modules/send2trash_osx.c index c995f2c..197c5d3 100644 --- a/modules/send2trash_osx.c +++ b/modules/send2trash_osx.c @@ -34,12 +34,25 @@ static PyMethodDef TrashMethods[] = { {NULL, NULL, 0, NULL} }; -PyMODINIT_FUNC -init_send2trash_osx(void) +static struct PyModuleDef TrashDef = { + PyModuleDef_HEAD_INIT, + "send2trash_osx", + NULL, + -1, + TrashMethods, + NULL, + NULL, + NULL, + NULL +}; + +PyObject * +PyInit_send2trash_osx(void) { - PyObject *m = Py_InitModule("_send2trash_osx", TrashMethods); + PyObject *m = PyModule_Create(&TrashDef); if (m == NULL) { - return; + return NULL; } + return m; } diff --git a/modules/send2trash_win.c b/modules/send2trash_win.c index e3ca11a..c9e8a31 100644 --- a/modules/send2trash_win.c +++ b/modules/send2trash_win.c @@ -58,11 +58,24 @@ static PyMethodDef TrashMethods[] = { {NULL, NULL, 0, NULL} }; -PyMODINIT_FUNC -init_send2trash_win(void) +static struct PyModuleDef TrashDef = { + PyModuleDef_HEAD_INIT, + "send2trash_win", + NULL, + -1, + TrashMethods, + NULL, + NULL, + NULL, + NULL +}; + +PyObject * +PyInit_send2trash_win(void) { - PyObject *m = Py_InitModule("_send2trash_win", TrashMethods); + PyObject *m = PyModule_Create(&TrashDef); if (m == NULL) { - return; + return NULL; } + return m; } \ No newline at end of file diff --git a/send2trash/__init__.py b/send2trash/__init__.py index 9457f4a..d6fa7f0 100644 --- a/send2trash/__init__.py +++ b/send2trash/__init__.py @@ -7,8 +7,8 @@ import sys if sys.platform == 'darwin': - from plat_osx import send2trash + from .plat_osx import send2trash elif sys.platform == 'win32': - from plat_win import send2trash + from .plat_win import send2trash else: - from plat_other import send2trash + from .plat_other import send2trash diff --git a/send2trash/plat_osx.py b/send2trash/plat_osx.py index 3b99f4f..aed6667 100644 --- a/send2trash/plat_osx.py +++ b/send2trash/plat_osx.py @@ -4,9 +4,9 @@ # which should be included with this package. The terms are also available at # http://www.hardcoded.net/licenses/bsd_license -import _send2trash_osx +import send2trash_osx def send2trash(path): - if not isinstance(path, unicode): - path = unicode(path, 'utf-8') - _send2trash_osx.send(path) + if not isinstance(path, str): + path = str(path, 'utf-8') + send2trash_osx.send(path) diff --git a/send2trash/plat_other.py b/send2trash/plat_other.py index d9375a6..70959a5 100644 --- a/send2trash/plat_other.py +++ b/send2trash/plat_other.py @@ -4,7 +4,7 @@ # which should be included with this package. The terms are also available at # http://www.hardcoded.net/licenses/bsd_license -from __future__ import unicode_literals + import sys import os import os.path as op @@ -60,8 +60,8 @@ def move_without_conflict(src, dst): os.rename(src, destpath) def send2trash(path): - if not isinstance(path, unicode): - path = unicode(path, sys.getfilesystemencoding()) + if not isinstance(path, str): + path = str(path, sys.getfilesystemencoding()) try: move_without_conflict(path, TRASH_PATH) except OSError: diff --git a/send2trash/plat_win.py b/send2trash/plat_win.py index 3aada5f..5f1a4d6 100644 --- a/send2trash/plat_win.py +++ b/send2trash/plat_win.py @@ -5,11 +5,11 @@ # http://www.hardcoded.net/licenses/bsd_license import os.path as op -import _send2trash_win +import send2trash_win def send2trash(path): - if not isinstance(path, unicode): - path = unicode(path, 'mbcs') + if not isinstance(path, str): + path = str(path, 'mbcs') if not op.isabs(path): path = op.abspath(path) - _send2trash_win.send(path) + send2trash_win.send(path) diff --git a/setup.py b/setup.py index 18740b8..e992080 100644 --- a/setup.py +++ b/setup.py @@ -8,13 +8,13 @@ exts = [] if sys.platform == 'darwin': exts.append(Extension( - '_send2trash_osx', + 'send2trash_osx', [op.join('modules', 'send2trash_osx.c')], extra_link_args=['-framework', 'CoreServices'], )) if sys.platform == 'win32': exts.append(Extension( - '_send2trash_win', + 'send2trash_win', [op.join('modules', 'send2trash_win.c')], extra_link_args = ['shell32.lib'], )) @@ -26,14 +26,14 @@ CLASSIFIERS = [ 'Operating System :: MacOS :: MacOS X', 'Operating System :: Microsoft :: Windows', 'Operating System :: POSIX', - 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 3', 'Programming Language :: Objective C', 'Programming Language :: C', 'Topic :: Desktop Environment :: File Managers', ] setup( - name='Send2Trash', + name='Send2Trash3k', version='1.0.1', author='Hardcoded Software', author_email='hsoft@hardcoded.net', From 7546aa606af3fcdcb9935d99068efc0742b8788d Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Fri, 9 Jul 2010 21:46:19 -0700 Subject: [PATCH 02/10] Fixed an infinite loop in plat_other when using a relative path in a mounted directory. --HG-- branch : py3k extra : transplant_source : %B4%A2%DB%EFn%BB%3A%F6%AE%06%F3%29%DB%06%FBE%D0%A2%BEt --- send2trash/plat_other.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/send2trash/plat_other.py b/send2trash/plat_other.py index 70959a5..657d4a3 100644 --- a/send2trash/plat_other.py +++ b/send2trash/plat_other.py @@ -33,8 +33,9 @@ EXTERNAL_CANDIDATES = [ def find_mount_point(path): # Even if something's wrong, "/" is a mount point, so the loop will exit. + path = op.abspath(path) # Required to avoid infinite loop while not op.ismount(path): - path = op.join(*op.split(path)[:-1]) + path = op.split(path)[0] return path def find_ext_volume_trash(volume_root): From 02dc392c452c45c9194004a5f72dc5411c1a52a7 Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Fri, 9 Jul 2010 21:49:46 -0700 Subject: [PATCH 03/10] Fixed a bug in plat_other where conflict handling wouldn't be done correctly in external volume. Thanks to John Benediktsson for the tip. --HG-- branch : py3k extra : transplant_source : %C6%11%009sx%B29%CF%EC%CC%D4%88r%BE%D8%BB%9AIa --- send2trash/plat_other.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/send2trash/plat_other.py b/send2trash/plat_other.py index 657d4a3..9ca7cc7 100644 --- a/send2trash/plat_other.py +++ b/send2trash/plat_other.py @@ -57,7 +57,7 @@ def move_without_conflict(src, dst): counter += 1 base_name, ext = op.splitext(filename) new_filename = '{0} {1}{2}'.format(base_name, counter, ext) - destpath = op.join(TRASH_PATH, new_filename) + destpath = op.join(dst, new_filename) os.rename(src, destpath) def send2trash(path): From d1fcb130867b797404bc5cf8c87d8336e59076f0 Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Sat, 10 Jul 2010 07:06:01 +0200 Subject: [PATCH 04/10] v1.0.2 --HG-- branch : py3k --- CHANGES | 5 +++++ README | 2 ++ setup.py | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index e5fb2fa..754dbe9 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,8 @@ +Version 1.0.2 -- 2010/07/10 +--- + +* Fixed bugs with external volumes in plat_other. + Version 1.0.1 -- 2010/04/19 --- diff --git a/README b/README index 2d71a06..7ebbca0 100644 --- a/README +++ b/README @@ -2,6 +2,8 @@ Send2Trash -- Send files to trash on all platforms ================================================== +This is a Python 3 package. The Python 2 package is at http://pypi.python.org/pypi/Send2Trash . + Send2Trash is a small package that sends files to the Trash (or Recycle Bin) *natively* and on *all platforms*. On OS X, it uses native ``FSMoveObjectToTrashSync`` Cocoa calls, on Windows, it uses native (and ugly) ``SHFileOperation`` win32 calls. On other platforms, it moves the file to the first folder it finds that looks like a trash (so far, it's known to work on Ubuntu). diff --git a/setup.py b/setup.py index e992080..4475fe0 100644 --- a/setup.py +++ b/setup.py @@ -34,7 +34,7 @@ CLASSIFIERS = [ setup( name='Send2Trash3k', - version='1.0.1', + version='1.0.2', author='Hardcoded Software', author_email='hsoft@hardcoded.net', packages=['send2trash'], From b5315cb73d2569c67f48b2e2bf2b24237d4b6b67 Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Tue, 13 Jul 2010 12:19:19 +0200 Subject: [PATCH 05/10] Added a setuptools-crappiness notice in the README. --HG-- branch : py3k extra : transplant_source : %F8%9A%02%C3%D2%AA%AB%2C%5D%94%EA%13%BD%D6%A0U%3F%D2N%C9 --- README | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README b/README index 7ebbca0..d623f49 100644 --- a/README +++ b/README @@ -18,6 +18,8 @@ On Windows, you'll need Visual Studio 2008 to compile it. Note that the install To have a cross-platform package you can ship around, you'll have compile the package on both platforms and merge the results so that both compiled modules are in the same package. +There's no package available on PyPI because packages produced by setuptools/distribute are all crappy (god I hate packaging). That's, I think, because I look at ``sys.platform`` to determine which of the extension module (if any) has to be built. However, when I create a ``sdist``, only the module of the platform I build it on is included in the source package. I don't know how to go around that and configuring that ``setup()`` function is hell. Just download the source from the repo. + Usage ----- From a6907d57a9d0cc55e9dbc0fab3378929590f2ca6 Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Sun, 17 Oct 2010 18:28:28 +0200 Subject: [PATCH 06/10] Converted the compiled osx module to ctypes. --HG-- branch : py3k --- modules/send2trash_osx.c | 58 ---------------------------------------- send2trash/plat_osx.py | 40 ++++++++++++++++++++++++--- setup.py | 6 ----- 3 files changed, 36 insertions(+), 68 deletions(-) delete mode 100644 modules/send2trash_osx.c diff --git a/modules/send2trash_osx.c b/modules/send2trash_osx.c deleted file mode 100644 index 197c5d3..0000000 --- a/modules/send2trash_osx.c +++ /dev/null @@ -1,58 +0,0 @@ -/* Copyright 2010 Hardcoded Software (http://www.hardcoded.net) - -This software is licensed under the "BSD" License as described in the "LICENSE" file, -which should be included with this package. The terms are also available at -http://www.hardcoded.net/licenses/bsd_license -*/ - -#define PY_SSIZE_T_CLEAN -#include "Python.h" -#include - -static PyObject* send2trash_osx_send(PyObject *self, PyObject *args) -{ - UInt8 *utf8_chars; - FSRef fp; - OSStatus op_result; - - if (!PyArg_ParseTuple(args, "es", "utf-8", &utf8_chars)) { - return NULL; - } - - FSPathMakeRefWithOptions(utf8_chars, kFSPathMakeRefDoNotFollowLeafSymlink, &fp, NULL); - op_result = FSMoveObjectToTrashSync(&fp, NULL, kFSFileOperationDefaultOptions); - PyMem_Free(utf8_chars); - if (op_result != noErr) { - PyErr_SetString(PyExc_OSError, GetMacOSStatusCommentString(op_result)); - return NULL; - } - return Py_None; -} - -static PyMethodDef TrashMethods[] = { - {"send", send2trash_osx_send, METH_VARARGS, ""}, - {NULL, NULL, 0, NULL} -}; - -static struct PyModuleDef TrashDef = { - PyModuleDef_HEAD_INIT, - "send2trash_osx", - NULL, - -1, - TrashMethods, - NULL, - NULL, - NULL, - NULL -}; - -PyObject * -PyInit_send2trash_osx(void) -{ - PyObject *m = PyModule_Create(&TrashDef); - if (m == NULL) { - return NULL; - } - return m; -} - diff --git a/send2trash/plat_osx.py b/send2trash/plat_osx.py index aed6667..ba58b6f 100644 --- a/send2trash/plat_osx.py +++ b/send2trash/plat_osx.py @@ -4,9 +4,41 @@ # which should be included with this package. The terms are also available at # http://www.hardcoded.net/licenses/bsd_license -import send2trash_osx +from ctypes import cdll, byref, Structure, c_char, c_char_p +from ctypes.util import find_library + +Foundation = cdll.LoadLibrary(find_library('Foundation')) +CoreServices = cdll.LoadLibrary(find_library('CoreServices')) + +GetMacOSStatusCommentString = Foundation.GetMacOSStatusCommentString +GetMacOSStatusCommentString.restype = c_char_p +FSPathMakeRefWithOptions = CoreServices.FSPathMakeRefWithOptions +FSMoveObjectToTrashSync = CoreServices.FSMoveObjectToTrashSync + +kFSPathMakeRefDefaultOptions = 0 +kFSPathMakeRefDoNotFollowLeafSymlink = 0x01 + +kFSFileOperationDefaultOptions = 0 +kFSFileOperationOverwrite = 0x01 +kFSFileOperationSkipSourcePermissionErrors = 0x02 +kFSFileOperationDoNotMoveAcrossVolumes = 0x04 +kFSFileOperationSkipPreflight = 0x08 + +class FSRef(Structure): + _fields_ = [('hidden', c_char * 80)] + +def check_op_result(op_result): + if op_result: + msg = GetMacOSStatusCommentString(op_result).decode('utf-8') + raise OSError(msg) def send2trash(path): - if not isinstance(path, str): - path = str(path, 'utf-8') - send2trash_osx.send(path) + if not isinstance(path, bytes): + path = path.encode('utf-8') + fp = FSRef() + opts = kFSPathMakeRefDoNotFollowLeafSymlink + op_result = FSPathMakeRefWithOptions(path, opts, byref(fp), None) + check_op_result(op_result) + opts = kFSFileOperationDefaultOptions + op_result = FSMoveObjectToTrashSync(byref(fp), None, opts) + check_op_result(op_result) diff --git a/setup.py b/setup.py index 4475fe0..0e4f406 100644 --- a/setup.py +++ b/setup.py @@ -6,12 +6,6 @@ from distutils.extension import Extension exts = [] -if sys.platform == 'darwin': - exts.append(Extension( - 'send2trash_osx', - [op.join('modules', 'send2trash_osx.c')], - extra_link_args=['-framework', 'CoreServices'], - )) if sys.platform == 'win32': exts.append(Extension( 'send2trash_win', From 899a3efeb3989d0b15288596ba85cce372d6b8a0 Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Sun, 17 Oct 2010 18:00:56 +0100 Subject: [PATCH 07/10] Converted the compiled win module to ctypes. --HG-- branch : py3k --- modules/send2trash_win.c | 81 ---------------------------------------- send2trash/plat_win.py | 44 +++++++++++++++++++++- setup.py | 11 ------ 3 files changed, 42 insertions(+), 94 deletions(-) delete mode 100644 modules/send2trash_win.c diff --git a/modules/send2trash_win.c b/modules/send2trash_win.c deleted file mode 100644 index c9e8a31..0000000 --- a/modules/send2trash_win.c +++ /dev/null @@ -1,81 +0,0 @@ -/* Copyright 2010 Hardcoded Software (http://www.hardcoded.net) - -This software is licensed under the "BSD" License as described in the "LICENSE" file, -which should be included with this package. The terms are also available at -http://www.hardcoded.net/licenses/bsd_license -*/ - -#define PY_SSIZE_T_CLEAN -#include "Python.h" - -#define WINDOWS_LEAN_AND_MEAN -#include "windows.h" -#include "shlobj.h" - -/* WARNING: If the filepath is not fully qualified, Windows deletes the file - rather than sending it to trash. - */ - -static PyObject* send2trash_win_send(PyObject *self, PyObject *args) -{ - SHFILEOPSTRUCTW op; - PyObject *filepath; - Py_ssize_t len; - WCHAR filechars[MAX_PATH+1]; - int r; - - if (!PyArg_ParseTuple(args, "O", &filepath)) { - return NULL; - } - - if (!PyUnicode_Check(filepath)) { - PyErr_SetString(PyExc_TypeError, "Unicode filename required"); - return NULL; - } - - len = PyUnicode_GET_SIZE(filepath); - memcpy(filechars, PyUnicode_AsUnicode(filepath), sizeof(WCHAR)*len); - filechars[len] = '\0'; - filechars[len+1] = '\0'; - - op.hwnd = 0; - op.wFunc = FO_DELETE; - op.pFrom = (LPCWSTR)&filechars; - op.pTo = NULL; - op.fFlags = FOF_ALLOWUNDO | FOF_NOCONFIRMATION | FOF_NOERRORUI | FOF_SILENT; - r = SHFileOperationW(&op); - - if (r != 0) { - PyErr_Format(PyExc_OSError, "Couldn't perform operation. Error code: %d", r); - return NULL; - } - - return Py_None; -} - -static PyMethodDef TrashMethods[] = { - {"send", send2trash_win_send, METH_VARARGS, ""}, - {NULL, NULL, 0, NULL} -}; - -static struct PyModuleDef TrashDef = { - PyModuleDef_HEAD_INIT, - "send2trash_win", - NULL, - -1, - TrashMethods, - NULL, - NULL, - NULL, - NULL -}; - -PyObject * -PyInit_send2trash_win(void) -{ - PyObject *m = PyModule_Create(&TrashDef); - if (m == NULL) { - return NULL; - } - return m; -} \ No newline at end of file diff --git a/send2trash/plat_win.py b/send2trash/plat_win.py index 5f1a4d6..d3607be 100644 --- a/send2trash/plat_win.py +++ b/send2trash/plat_win.py @@ -4,12 +4,52 @@ # which should be included with this package. The terms are also available at # http://www.hardcoded.net/licenses/bsd_license +from ctypes import windll, Structure, byref, c_uint +from ctypes.wintypes import HWND, UINT, LPCWSTR, BOOL import os.path as op -import send2trash_win + +shell32 = windll.shell32 +SHFileOperationW = shell32.SHFileOperationW + +class SHFILEOPSTRUCTW(Structure): + _fields_ = [ + ("hwnd", HWND), + ("wFunc", UINT), + ("pFrom", LPCWSTR), + ("pTo", LPCWSTR), + ("fFlags", c_uint), + ("fAnyOperationsAborted", BOOL), + ("hNameMappings", c_uint), + ("lpszProgressTitle", LPCWSTR), + ] + +FO_MOVE = 1 +FO_COPY = 2 +FO_DELETE = 3 +FO_RENAME = 4 + +FOF_MULTIDESTFILES = 1 +FOF_SILENT = 4 +FOF_NOCONFIRMATION = 16 +FOF_ALLOWUNDO = 64 +FOF_NOERRORUI = 1024 def send2trash(path): if not isinstance(path, str): path = str(path, 'mbcs') if not op.isabs(path): path = op.abspath(path) - send2trash_win.send(path) + fileop = SHFILEOPSTRUCTW() + fileop.hwnd = 0 + fileop.wFunc = FO_DELETE + fileop.pFrom = LPCWSTR(path + '\0') + fileop.pTo = None + fileop.fFlags = FOF_ALLOWUNDO | FOF_NOCONFIRMATION | FOF_NOERRORUI | FOF_SILENT + fileop.fAnyOperationsAborted = 0 + fileop.hNameMappings = 0 + fileop.lpszProgressTitle = None + result = SHFileOperationW(byref(fileop)) + if result: + msg = "Couldn't perform operation. Error code: %d" % result + raise OSError(msg) + diff --git a/setup.py b/setup.py index 0e4f406..524e909 100644 --- a/setup.py +++ b/setup.py @@ -2,16 +2,6 @@ import sys import os.path as op from setuptools import setup -from distutils.extension import Extension - -exts = [] - -if sys.platform == 'win32': - exts.append(Extension( - 'send2trash_win', - [op.join('modules', 'send2trash_win.c')], - extra_link_args = ['shell32.lib'], - )) CLASSIFIERS = [ 'Development Status :: 5 - Production/Stable', @@ -33,7 +23,6 @@ setup( author_email='hsoft@hardcoded.net', packages=['send2trash'], scripts=[], - ext_modules = exts, url='http://hg.hardcoded.net/send2trash/', license='BSD License', description='Send file to trash natively under Mac OS X, Windows and Linux.', From 506e48b2e0603834e2e14762febe9207d6388bfd Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Mon, 18 Oct 2010 12:13:37 +0200 Subject: [PATCH 08/10] v1.1.0 --HG-- branch : py3k --- CHANGES | 14 +++++++++++--- README | 10 +++------- setup.py | 6 ++++-- 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/CHANGES b/CHANGES index 754dbe9..0b2be57 100644 --- a/CHANGES +++ b/CHANGES @@ -1,14 +1,22 @@ +Changes +======= + +Version 1.1.0 -- 2010/10/18 +--------------------------- + +* Converted compiled modules to ctypes so that cross-platform compilation isn't necessary anymore. + Version 1.0.2 -- 2010/07/10 ---- +--------------------------- * Fixed bugs with external volumes in plat_other. Version 1.0.1 -- 2010/04/19 ---- +--------------------------- * Fixed memory leak in OS X module. Version 1.0.0 -- 2010/04/07 ---- +--------------------------- * Initial Release \ No newline at end of file diff --git a/README b/README index d623f49..0e780d5 100644 --- a/README +++ b/README @@ -7,18 +7,14 @@ This is a Python 3 package. The Python 2 package is at http://pypi.python.org/py Send2Trash is a small package that sends files to the Trash (or Recycle Bin) *natively* and on *all platforms*. On OS X, it uses native ``FSMoveObjectToTrashSync`` Cocoa calls, on Windows, it uses native (and ugly) ``SHFileOperation`` win32 calls. On other platforms, it moves the file to the first folder it finds that looks like a trash (so far, it's known to work on Ubuntu). +``ctypes`` is used to access native libraries, so no compilation is necessary. + Installation ------------ Download the source from http://hg.hardcoded.net/send2trash and install it with:: ->>> sudo python setup.py install - -On Windows, you'll need Visual Studio 2008 to compile it. Note that the install you'll get will not be a "universal" package. If you install it on OS X, only the "osx" module will be compiled, and if you install it on Windows, only the "win" module will be compiled. - -To have a cross-platform package you can ship around, you'll have compile the package on both platforms and merge the results so that both compiled modules are in the same package. - -There's no package available on PyPI because packages produced by setuptools/distribute are all crappy (god I hate packaging). That's, I think, because I look at ``sys.platform`` to determine which of the extension module (if any) has to be built. However, when I create a ``sdist``, only the module of the platform I build it on is included in the source package. I don't know how to go around that and configuring that ``setup()`` function is hell. Just download the source from the repo. +>>> python setup.py install Usage ----- diff --git a/setup.py b/setup.py index 524e909..0bc4a8b 100644 --- a/setup.py +++ b/setup.py @@ -16,9 +16,11 @@ CLASSIFIERS = [ 'Topic :: Desktop Environment :: File Managers', ] +LONG_DESCRIPTION = open('README', 'rt').read() + '\n\n' + open('CHANGES', 'rt').read() + setup( name='Send2Trash3k', - version='1.0.2', + version='1.1.0', author='Hardcoded Software', author_email='hsoft@hardcoded.net', packages=['send2trash'], @@ -26,7 +28,7 @@ setup( url='http://hg.hardcoded.net/send2trash/', license='BSD License', description='Send file to trash natively under Mac OS X, Windows and Linux.', - long_description=open('README').read(), + long_description=LONG_DESCRIPTION, classifiers=CLASSIFIERS, zip_safe=False, ) \ No newline at end of file From 04ee6eaf9f55de4b8d3e69718e45e71c6d2d0dec Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Mon, 18 Oct 2010 12:13:42 +0200 Subject: [PATCH 09/10] Added tag 1.1.0 for changeset de5f43fcce5e --HG-- branch : py3k --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 6938dd7..a012386 100644 --- a/.hgtags +++ b/.hgtags @@ -1,2 +1,3 @@ 48c2103380f5e7deca49364f44fb31ded9942bb7 1.0.0 a7e04d8e47e161daaa1f031a7c1e98c52fa269ac 1.0.1 +de5f43fcce5e776eb28306951939afb9946cbd3d 1.1.0 From 9189e685b1afab1d3bcfc8dc8bf88a9d781a271f Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Mon, 18 Oct 2010 12:22:13 +0200 Subject: [PATCH 10/10] Adjusted packaging metadata for 1.1.0. --HG-- branch : py3k --- MANIFEST.in | 1 + setup.py | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) create mode 100644 MANIFEST.in diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..d935839 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1 @@ +include CHANGES \ No newline at end of file diff --git a/setup.py b/setup.py index 0bc4a8b..f6b309c 100644 --- a/setup.py +++ b/setup.py @@ -11,8 +11,6 @@ CLASSIFIERS = [ 'Operating System :: Microsoft :: Windows', 'Operating System :: POSIX', 'Programming Language :: Python :: 3', - 'Programming Language :: Objective C', - 'Programming Language :: C', 'Topic :: Desktop Environment :: File Managers', ]