diff --git a/.gitignore b/.gitignore index c544dbf..93e6c8b 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ .DS_Store /.tox __pycache__ +/env \ No newline at end of file diff --git a/send2trash/__init__.py b/send2trash/__init__.py index 3a8c884..4c3f7e9 100644 --- a/send2trash/__init__.py +++ b/send2trash/__init__.py @@ -1,16 +1,16 @@ # Copyright 2013 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 +# 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 import sys -from .exceptions import TrashPermissionError +from .exceptions import TrashPermissionError # noqa: F401 -if sys.platform == 'darwin': +if sys.platform == "darwin": from .plat_osx import send2trash -elif sys.platform == 'win32': +elif sys.platform == "win32": from .plat_win import send2trash else: try: @@ -18,4 +18,4 @@ else: from .plat_gio import send2trash except ImportError: # Oh well, let's fallback to our own Freedesktop trash implementation - from .plat_other import send2trash + from .plat_other import send2trash # noqa: F401 diff --git a/send2trash/compat.py b/send2trash/compat.py index 8092d0a..9e9b5fb 100644 --- a/send2trash/compat.py +++ b/send2trash/compat.py @@ -15,6 +15,6 @@ if PY3: # environb will be unset under Windows, but then again we're not supposed to use it. environb = os.environb else: - text_type = unicode + text_type = unicode # noqa: F821 binary_type = str environb = os.environ diff --git a/send2trash/exceptions.py b/send2trash/exceptions.py index 4132a6d..9d5d91f 100644 --- a/send2trash/exceptions.py +++ b/send2trash/exceptions.py @@ -6,6 +6,7 @@ if PY3: else: _permission_error = OSError + class TrashPermissionError(_permission_error): """A permission error specific to a trash directory. @@ -20,6 +21,6 @@ class TrashPermissionError(_permission_error): data between partitions, devices, or network drives, so we don't do it as a fallback. """ + def __init__(self, filename): - _permission_error.__init__(self, errno.EACCES, "Permission denied", - filename) + _permission_error.__init__(self, errno.EACCES, "Permission denied", filename) diff --git a/send2trash/plat_win.py b/send2trash/plat_win.py index a39833c..64ae85c 100644 --- a/send2trash/plat_win.py +++ b/send2trash/plat_win.py @@ -17,4 +17,4 @@ if int(version().split(".", 1)[0]) >= 6: from .plat_win_legacy import send2trash else: # use SHFileOperation as fallback - from .plat_win_legacy import send2trash + from .plat_win_legacy import send2trash # noqa: F401