Skip to content

Commit 5d8009c

Browse files
committed
Fix remaining linter issues in fs modules
1 parent 66d49a8 commit 5d8009c

9 files changed

Lines changed: 12 additions & 18 deletions

File tree

fs/appfs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class _CopyInitMeta(abc.ABCMeta):
4444

4545
def __new__(mcls, classname, bases, cls_dict):
4646
cls_dict.setdefault("__init__", bases[0].__init__)
47-
return super().__new__(mcls, classname, bases, cls_dict)
47+
return super(abc.ABCMeta, mcls).__new__(mcls, classname, bases, cls_dict)
4848

4949

5050
@six.add_metaclass(_CopyInitMeta)

fs/ftpfs.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,8 +346,7 @@ def seek(self, pos, whence=Seek.set):
346346

347347

348348
class FTPFS(FS):
349-
"""A FTP (File Transport Protocol) Filesystem.
350-
"""
349+
"""A FTP (File Transport Protocol) Filesystem."""
351350

352351
_meta = {
353352
"invalid_path_chars": "\0",

fs/glob.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,7 @@ def imatch(pattern, path):
9595

9696

9797
class Globber(object):
98-
"""A generator of glob results.
99-
"""
98+
"""A generator of glob results."""
10099

101100
def __init__(
102101
self,

fs/lrucache.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ class LRUCache(OrderedDict, typing.Generic[_K, _V]):
2121
"""
2222

2323
def __init__(self, cache_size):
24-
"""Create a new LRUCache with the given size."""
2524
# type: (int) -> None
25+
"""Create a new LRUCache with the given size."""
2626
self.cache_size = cache_size
2727
super(LRUCache, self).__init__()
2828

fs/mirror.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def mirror(
7373
workers (int): Number of worker threads used
7474
(0 for single threaded). Set to a relatively low number
7575
for network filesystems, 4 would be a good start.
76-
76+
7777
"""
7878

7979
def src():

fs/mountfs.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@ class MountError(Exception):
4545

4646

4747
class MountFS(FS):
48-
"""A virtual filesystem that maps directories on to other file-systems.
49-
"""
48+
"""A virtual filesystem that maps directories on to other file-systems."""
5049

5150
_meta = {
5251
"virtual": True,
@@ -57,14 +56,14 @@ class MountFS(FS):
5756
}
5857

5958
def __init__(self, auto_close=True):
59+
# type: (bool) -> None
6060
"""Create a new `MountFS` instance.
6161
6262
Arguments:
6363
auto_close (bool): If `True` (the default), the child
6464
filesystems will be closed when `MountFS` is closed.
6565
6666
"""
67-
# type: (bool) -> None
6867
super(MountFS, self).__init__()
6968
self.auto_close = auto_close
7069
self.default_fs = MemoryFS() # type: FS

fs/permissions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def __init__(
104104
sticky (bool, optional): A boolean for the *sticky* bit.
105105
setuid (bool, optional): A boolean for the *setuid* bit.
106106
setguid (bool, optional): A boolean for the *setguid* bit.
107-
107+
108108
"""
109109
if names is not None:
110110
self._perms = set(names)

fs/tempfs.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@
2727

2828
@six.python_2_unicode_compatible
2929
class TempFS(OSFS):
30-
"""A temporary filesystem on the OS.
31-
"""
30+
"""A temporary filesystem on the OS."""
3231

3332
def __init__(
3433
self,

fs/walk.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,7 @@
5050

5151

5252
class Walker(object):
53-
"""A walker object recursively lists directories in a filesystem.
54-
"""
53+
"""A walker object recursively lists directories in a filesystem."""
5554

5655
def __init__(
5756
self,
@@ -128,8 +127,7 @@ def _raise_errors(cls, path, error):
128127
@classmethod
129128
def _calculate_depth(cls, path):
130129
# type: (Text) -> int
131-
"""Calculate the 'depth' of a directory path (i.e. count components).
132-
"""
130+
"""Calculate the 'depth' of a directory path (i.e. count components)."""
133131
_path = path.strip("/")
134132
return _path.count("/") + 1 if _path else 0
135133

@@ -508,6 +506,7 @@ class BoundWalker(typing.Generic[_F]):
508506
"""
509507

510508
def __init__(self, fs, walker_class=Walker):
509+
# type: (_F, Type[Walker]) -> None
511510
"""Create a new walker bound to the given filesystem.
512511
513512
Arguments:
@@ -516,7 +515,6 @@ def __init__(self, fs, walker_class=Walker):
516515
sub-class. The default uses `~fs.walk.Walker`.
517516
518517
"""
519-
# type: (_F, Type[Walker]) -> None
520518
self.fs = fs
521519
self.walker_class = walker_class
522520

0 commit comments

Comments
 (0)