@@ -812,12 +812,12 @@ def put(self, lpath, rpath, recursive=False, callback=_DEFAULT_CALLBACK, **kwarg
812
812
self .put_file (lpath , rpath , ** kwargs )
813
813
814
814
def head (self , path , size = 1024 ):
815
- """ Get the first ``size`` bytes from file """
815
+ """Get the first ``size`` bytes from file"""
816
816
with self .open (path , "rb" ) as f :
817
817
return f .read (size )
818
818
819
819
def tail (self , path , size = 1024 ):
820
- """ Get the last ``size`` bytes from file """
820
+ """Get the last ``size`` bytes from file"""
821
821
with self .open (path , "rb" ) as f :
822
822
f .seek (max (- size , - f .size ), 2 )
823
823
return f .read ()
@@ -879,7 +879,7 @@ def expand_path(self, path, recursive=False, maxdepth=None):
879
879
return list (sorted (out ))
880
880
881
881
def mv (self , path1 , path2 , recursive = False , maxdepth = None , ** kwargs ):
882
- """ Move file(s) from one location to another """
882
+ """Move file(s) from one location to another"""
883
883
self .copy (path1 , path2 , recursive = recursive , maxdepth = maxdepth )
884
884
self .rm (path1 , recursive = recursive )
885
885
@@ -944,6 +944,10 @@ def open(self, path, mode="rb", block_size=None, cache_options=None, **kwargs):
944
944
"""
945
945
Return a file-like object from the filesystem
946
946
947
+ The file-like object returned ignores an eventual PrefixFileSystem:
948
+ - the ``.path`` attribute is always an absolute path
949
+ - the``.fs`` attribute, if present, would be the wrapped file-system
950
+
947
951
The resultant instance must function correctly in a context ``with``
948
952
block.
949
953
@@ -1341,14 +1345,14 @@ def discard(self):
1341
1345
"""Throw away temporary file"""
1342
1346
1343
1347
def info (self ):
1344
- """ File information about this path """
1348
+ """File information about this path"""
1345
1349
if "r" in self .mode :
1346
1350
return self .details
1347
1351
else :
1348
1352
raise ValueError ("Info not available while writing" )
1349
1353
1350
1354
def tell (self ):
1351
- """ Current file location """
1355
+ """Current file location"""
1352
1356
return self .loc
1353
1357
1354
1358
def seek (self , loc , whence = 0 ):
@@ -1455,7 +1459,7 @@ def _upload_chunk(self, final=False):
1455
1459
# may not yet have been initialized, may need to call _initialize_upload
1456
1460
1457
1461
def _initiate_upload (self ):
1458
- """ Create remote file/upload """
1462
+ """Create remote file/upload"""
1459
1463
pass
1460
1464
1461
1465
def _fetch_range (self , start , end ):
0 commit comments