1
0
mirror of https://github.com/arsenetar/send2trash.git synced 2025-05-08 17:59:50 +00:00

Compare commits

..

No commits in common. "be402728fb7f5f889961d38ca10648ac97379845" and "d37197c4f7e3e7fa083930aaac0841d1895db134" have entirely different histories.

11 changed files with 27 additions and 31 deletions

View File

@ -6,16 +6,16 @@
import sys import sys
from send2trash.exceptions import TrashPermissionError # noqa: F401 from .exceptions import TrashPermissionError # noqa: F401
if sys.platform == "darwin": if sys.platform == "darwin":
from send2trash.mac import send2trash from .mac import send2trash
elif sys.platform == "win32": elif sys.platform == "win32":
from send2trash.win import send2trash from .win import send2trash
else: else:
try: try:
# If we can use gio, let's use it # If we can use gio, let's use it
from send2trash.plat_gio import send2trash from .plat_gio import send2trash
except ImportError: except ImportError:
# Oh well, let's fallback to our own Freedesktop trash implementation # Oh well, let's fallback to our own Freedesktop trash implementation
from send2trash.plat_other import send2trash # noqa: F401 from .plat_other import send2trash # noqa: F401

View File

@ -1,5 +1,5 @@
import errno import errno
from send2trash.compat import PY3 from .compat import PY3
if PY3: if PY3:
_permission_error = PermissionError # noqa: F821 _permission_error = PermissionError # noqa: F821

View File

@ -11,10 +11,10 @@ from sys import version_info
macos_ver = tuple(int(part) for part in mac_ver()[0].split(".")) macos_ver = tuple(int(part) for part in mac_ver()[0].split("."))
if version_info >= (3, 6) and macos_ver >= (10, 9): if version_info >= (3, 6) and macos_ver >= (10, 9):
try: try:
from send2trash.mac.modern import send2trash from .modern import send2trash
except ImportError: except ImportError:
# Try to fall back to ctypes version, although likely problematic still # Try to fall back to ctypes version, although likely problematic still
from send2trash.mac.legacy import send2trash from .legacy import send2trash
else: else:
# Just use the old version otherwise # Just use the old version otherwise
from send2trash.mac.legacy import send2trash # noqa: F401 from .legacy import send2trash # noqa: F401

View File

@ -9,8 +9,8 @@ from __future__ import unicode_literals
from ctypes import cdll, byref, Structure, c_char, c_char_p from ctypes import cdll, byref, Structure, c_char, c_char_p
from ctypes.util import find_library from ctypes.util import find_library
from send2trash.compat import binary_type from ..compat import binary_type
from send2trash.util import preprocess_paths from ..util import preprocess_paths
Foundation = cdll.LoadLibrary(find_library("Foundation")) Foundation = cdll.LoadLibrary(find_library("Foundation"))
CoreServices = cdll.LoadLibrary(find_library("CoreServices")) CoreServices = cdll.LoadLibrary(find_library("CoreServices"))

View File

@ -5,8 +5,8 @@
# http://www.hardcoded.net/licenses/bsd_license # http://www.hardcoded.net/licenses/bsd_license
from Foundation import NSFileManager, NSURL from Foundation import NSFileManager, NSURL
from send2trash.compat import text_type from ..compat import text_type
from send2trash.util import preprocess_paths from ..util import preprocess_paths
def check_op_result(op_result): def check_op_result(op_result):

View File

@ -5,8 +5,8 @@
# http://www.hardcoded.net/licenses/bsd_license # http://www.hardcoded.net/licenses/bsd_license
from gi.repository import GObject, Gio from gi.repository import GObject, Gio
from send2trash.exceptions import TrashPermissionError from .exceptions import TrashPermissionError
from send2trash.util import preprocess_paths from .util import preprocess_paths
def send2trash(paths): def send2trash(paths):

View File

@ -30,9 +30,9 @@ except ImportError:
# Python 2 # Python 2
from urllib import quote from urllib import quote
from send2trash.compat import text_type, environb from .compat import text_type, environb
from send2trash.util import preprocess_paths from .util import preprocess_paths
from send2trash.exceptions import TrashPermissionError from .exceptions import TrashPermissionError
try: try:
fsencode = os.fsencode # Python 3 fsencode = os.fsencode # Python 3

View File

@ -11,10 +11,10 @@ from platform import version
if int(version().split(".", 1)[0]) >= 6: if int(version().split(".", 1)[0]) >= 6:
try: try:
# Attempt to use pywin32 to use IFileOperation # Attempt to use pywin32 to use IFileOperation
from send2trash.win.modern import send2trash from .modern import send2trash
except ImportError: except ImportError:
# use SHFileOperation as fallback # use SHFileOperation as fallback
from send2trash.win.legacy import send2trash from .legacy import send2trash
else: else:
# use SHFileOperation as fallback # use SHFileOperation as fallback
from send2trash.win.legacy import send2trash # noqa: F401 from .legacy import send2trash # noqa: F401

View File

@ -6,8 +6,8 @@
from __future__ import unicode_literals from __future__ import unicode_literals
import os.path as op import os.path as op
from send2trash.compat import text_type from ..compat import text_type
from send2trash.util import preprocess_paths from ..util import preprocess_paths
from ctypes import ( from ctypes import (
windll, windll,

View File

@ -6,13 +6,13 @@
from __future__ import unicode_literals from __future__ import unicode_literals
import os.path as op import os.path as op
from send2trash.compat import text_type from ..compat import text_type
from send2trash.util import preprocess_paths from ..util import preprocess_paths
from platform import version from platform import version
import pythoncom import pythoncom
import pywintypes import pywintypes
from win32com.shell import shell, shellcon from win32com.shell import shell, shellcon
from send2trash.win.IFileOperationProgressSink import create_sink from .IFileOperationProgressSink import create_sink
def send2trash(paths): def send2trash(paths):

View File

@ -29,14 +29,10 @@ classifiers =
Topic :: Desktop Environment :: File Managers Topic :: Desktop Environment :: File Managers
[options] [options]
packages = find: packages = send2trash
tests_require = pytest tests_require = pytest
python_requires = >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.* python_requires = >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*
[options.packages.find]
include=
send2trash*
[options.extras_require] [options.extras_require]
win32 = pywin32; sys_platform == "win32" win32 = pywin32; sys_platform == "win32"
objc = pyobjc-framework-Cocoa; sys_platform == "darwin" objc = pyobjc-framework-Cocoa; sys_platform == "darwin"