Exemple #1
0
 def access(self,
            path: str,
            name_or_id: Union[int, str] = None,
            required_perms: str = None):
     _fs, _path = self.delegate_path(path)
     with unwrap_errors(path):
         return _fs.access(_path, name_or_id, required_perms)
Exemple #2
0
 def chown(self,
           fs_path: str,
           uid: int,
           gid: int,
           recursive: Optional[bool] = False):
     _fs, _path = self.delegate_path(fs_path)
     with unwrap_errors(fs_path):
         return _fs.chown(_path, uid, gid, recursive)
Exemple #3
0
 def get_permissions(self, path):
     _fs, _path = self.delegate_path(path)
     with unwrap_errors(path):
         return _fs.get_permissions(_path)
Exemple #4
0
 def getinfo(self, path: str, get_actual: bool = False, namespaces=None):
     _fs, _path = self.delegate_path(path)
     with unwrap_errors(path):
         return _fs.getinfo(_path,
                            get_actual=get_actual,
                            namespaces=namespaces)
Exemple #5
0
 def format_list(self, basedir, listing):
     _fs, _path = self.delegate_path(basedir)
     with unwrap_errors(basedir):
         return _fs.format_list(_path, listing)
Exemple #6
0
 def get_permissions(self, path):
     _fs, _path = self.delegate_path(path)
     with unwrap_errors(path):
         return _fs.get_permissions(_path)
Exemple #7
0
 def remove(self, path):
     _fs, _path = self.delegate_path(path)
     with unwrap_errors(path):
         return _fs.remove(_path)
Exemple #8
0
 def _open(self, name, mode):
     with unwrap_errors(name):
         f = self.fs.open(name, mode)
     return File(f)
Exemple #9
0
 def _save(self, name, content):
     with unwrap_errors(name):
         self.fs.makedirs(dirname(name), recreate=True)
         self.fs.setbinfile(name, content)
     return name
Exemple #10
0
 def size(self, name):
     with unwrap_errors(name):
         size = self.fs.getsize(name)
     return size
Exemple #11
0
 def url(self, name):
     with unwrap_errors(name):
         ret = self.base_url + abspath(name)
     return ret
Exemple #12
0
 def delete(self, name):
     with unwrap_errors(name):
         try:
             self.fs.remove(name)
         except ResourceNotFoundError:
             pass
Exemple #13
0
 def _save(self, name, content):
     with unwrap_errors(name):
         self.fs.makedirs(dirname(name), recreate=True)
         self.fs.setbinfile(name, content)
     return name
Exemple #14
0
 def _open(self, name, mode):
     with unwrap_errors(name):
         f = self.fs.open(name, mode)
     return File(f)
Exemple #15
0
 def remove(self, path):
     _fs, _path = self.delegate_path(path)
     with unwrap_errors(path):
         return _fs.remove(_path)
Exemple #16
0
 def delete(self, name):
     with unwrap_errors(name):
         try:
             self.fs.remove(name)
         except ResourceNotFoundError:
             pass
Exemple #17
0
 def url(self, name):
     with unwrap_errors(name):
         ret = self.base_url + abspath(name)
     return ret
Exemple #18
0
 def getinfo(self, path: str, get_actual: bool = False, namespaces=None):
     _fs, _path = self.delegate_path(path)
     with unwrap_errors(path):
         return _fs.getinfo(_path, get_actual=get_actual, namespaces=namespaces)
Exemple #19
0
 def removedir(self, path, rf=False):
     _fs, _path = self.delegate_path(path)
     with unwrap_errors(path):
         return _fs.removedir(_path)
Exemple #20
0
 def getmtime(self, path):
     _fs, _path = self.delegate_path(path)
     with unwrap_errors(path):
         return _fs.getmtime(_path)
Exemple #21
0
 def move(self, src_path, dst_path, overwrite=True):
     _fs, _src_path = self.delegate_path(src_path)
     _, _dst_path = self.delegate_path(dst_path)
     with unwrap_errors({_src_path: src_path, _dst_path: dst_path}):
         return _fs.move(_src_path, _dst_path, overwrite=overwrite)
Exemple #22
0
 def format_list(self, basedir, listing):
     _fs, _path = self.delegate_path(basedir)
     with unwrap_errors(basedir):
         return _fs.format_list(_path, listing)
Exemple #23
0
 def getmtime(self, path):
     _fs, _path = self.delegate_path(path)
     with unwrap_errors(path):
         return _fs.getmtime(_path)
Exemple #24
0
 def check_access(self, path=None, user=None, perms=None):
     _fs, _path = self.delegate_path(path)
     with unwrap_errors(path):
         return _fs.check_access(_path, user, perms)
Exemple #25
0
 def check_access(self, path=None, user=None, perms=None):
     _fs, _path = self.delegate_path(path)
     with unwrap_errors(path):
         return _fs.check_access(_path, user, perms)
Exemple #26
0
 def chown(self, fs_path: str, uid: int, gid: int, recursive: Optional[bool]=False):
     _fs, _path = self.delegate_path(fs_path)
     with unwrap_errors(fs_path):
         return _fs.chown(_path, uid, gid, recursive)
Exemple #27
0
 def chmod(self, path: str, mode: oct, recursive: bool = False) -> None:
     _fs, _path = self.delegate_path(path)
     with unwrap_errors(path):
         return _fs.chmod(_path, mode, recursive)
Exemple #28
0
 def chmod(self, path: str, mode: oct, recursive: bool = False) -> None:
     _fs, _path = self.delegate_path(path)
     with unwrap_errors(path):
         return _fs.chmod(_path, mode, recursive)
Exemple #29
0
 def stat(self, path):
     _fs, _path = self.delegate_path(path)
     with unwrap_errors(path):
         return _fs.stat(_path)
Exemple #30
0
 def access(self, path: str, name_or_id: Union[int, str]=None, required_perms: str=None):
     _fs, _path = self.delegate_path(path)
     with unwrap_errors(path):
         return _fs.access(_path, name_or_id, required_perms)
Exemple #31
0
 def removedir(self, path, rf=False):
     _fs, _path = self.delegate_path(path)
     with unwrap_errors(path):
         return _fs.removedir(_path)
Exemple #32
0
 def stat(self, path):
     _fs, _path = self.delegate_path(path)
     with unwrap_errors(path):
         return _fs.stat(_path)
Exemple #33
0
 def move(self, src_path, dst_path, overwrite=True):
     _fs, _src_path = self.delegate_path(src_path)
     _, _dst_path = self.delegate_path(dst_path)
     with unwrap_errors({_src_path: src_path, _dst_path: dst_path}):
         return _fs.move(_src_path, _dst_path, overwrite=overwrite)
Exemple #34
0
 def size(self, name):
     with unwrap_errors(name):
         size = self.fs.getsize(name)
     return size