Browse Source

Fix some flake8 errors and cleanup

- Fix some flake8 formatting errors
- Auto-format files edited
- Also ignore some flake8 errors when they are intented
- Update .gitignore to ingore local env
tags/1.6.0b1
Andrew Senetar 8 months ago
parent
commit
2e9fa38f56
Signed by: arsenetar <[email protected]> GPG Key ID: C63300DCE48AB2F1
5 changed files with 12 additions and 10 deletions
  1. +1
    -0
      .gitignore
  2. +6
    -6
      send2trash/__init__.py
  3. +1
    -1
      send2trash/compat.py
  4. +3
    -2
      send2trash/exceptions.py
  5. +1
    -1
      send2trash/plat_win.py

+ 1
- 0
.gitignore View File

@@ -5,3 +5,4 @@
.DS_Store
/.tox
__pycache__
/env

+ 6
- 6
send2trash/__init__.py View File

@@ -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

+ 1
- 1
send2trash/compat.py View File

@@ -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

+ 3
- 2
send2trash/exceptions.py View File

@@ -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)

+ 1
- 1
send2trash/plat_win.py View File

@@ -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

Loading…
Cancel
Save