mirror of
https://github.com/arsenetar/send2trash.git
synced 2025-05-07 09:29:48 +00:00
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
This commit is contained in:
parent
1e099724c5
commit
2e9fa38f56
1
.gitignore
vendored
1
.gitignore
vendored
@ -5,3 +5,4 @@
|
|||||||
.DS_Store
|
.DS_Store
|
||||||
/.tox
|
/.tox
|
||||||
__pycache__
|
__pycache__
|
||||||
|
/env
|
@ -6,11 +6,11 @@
|
|||||||
|
|
||||||
import sys
|
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
|
from .plat_osx import send2trash
|
||||||
elif sys.platform == 'win32':
|
elif sys.platform == "win32":
|
||||||
from .plat_win import send2trash
|
from .plat_win import send2trash
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
@ -18,4 +18,4 @@ else:
|
|||||||
from .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 .plat_other import send2trash
|
from .plat_other import send2trash # noqa: F401
|
||||||
|
@ -15,6 +15,6 @@ if PY3:
|
|||||||
# environb will be unset under Windows, but then again we're not supposed to use it.
|
# environb will be unset under Windows, but then again we're not supposed to use it.
|
||||||
environb = os.environb
|
environb = os.environb
|
||||||
else:
|
else:
|
||||||
text_type = unicode
|
text_type = unicode # noqa: F821
|
||||||
binary_type = str
|
binary_type = str
|
||||||
environb = os.environ
|
environb = os.environ
|
||||||
|
@ -6,6 +6,7 @@ if PY3:
|
|||||||
else:
|
else:
|
||||||
_permission_error = OSError
|
_permission_error = OSError
|
||||||
|
|
||||||
|
|
||||||
class TrashPermissionError(_permission_error):
|
class TrashPermissionError(_permission_error):
|
||||||
"""A permission error specific to a trash directory.
|
"""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
|
data between partitions, devices, or network drives, so we don't do it as
|
||||||
a fallback.
|
a fallback.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, filename):
|
def __init__(self, filename):
|
||||||
_permission_error.__init__(self, errno.EACCES, "Permission denied",
|
_permission_error.__init__(self, errno.EACCES, "Permission denied", filename)
|
||||||
filename)
|
|
||||||
|
@ -17,4 +17,4 @@ if int(version().split(".", 1)[0]) >= 6:
|
|||||||
from .plat_win_legacy import send2trash
|
from .plat_win_legacy import send2trash
|
||||||
else:
|
else:
|
||||||
# use SHFileOperation as fallback
|
# use SHFileOperation as fallback
|
||||||
from .plat_win_legacy import send2trash
|
from .plat_win_legacy import send2trash # noqa: F401
|
||||||
|
Loading…
x
Reference in New Issue
Block a user