示例#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)
示例#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)
示例#3
0
 def get_permissions(self, path):
     _fs, _path = self.delegate_path(path)
     with unwrap_errors(path):
         return _fs.get_permissions(_path)
示例#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)
示例#5
0
 def format_list(self, basedir, listing):
     _fs, _path = self.delegate_path(basedir)
     with unwrap_errors(basedir):
         return _fs.format_list(_path, listing)
示例#6
0
 def get_permissions(self, path):
     _fs, _path = self.delegate_path(path)
     with unwrap_errors(path):
         return _fs.get_permissions(_path)
示例#7
0
 def remove(self, path):
     _fs, _path = self.delegate_path(path)
     with unwrap_errors(path):
         return _fs.remove(_path)
示例#8
0
 def _open(self, name, mode):
     with unwrap_errors(name):
         f = self.fs.open(name, mode)
     return File(f)
示例#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
示例#10
0
 def size(self, name):
     with unwrap_errors(name):
         size = self.fs.getsize(name)
     return size
示例#11
0
 def url(self, name):
     with unwrap_errors(name):
         ret = self.base_url + abspath(name)
     return ret
示例#12
0
 def delete(self, name):
     with unwrap_errors(name):
         try:
             self.fs.remove(name)
         except ResourceNotFoundError:
             pass
示例#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
示例#14
0
 def _open(self, name, mode):
     with unwrap_errors(name):
         f = self.fs.open(name, mode)
     return File(f)
示例#15
0
 def remove(self, path):
     _fs, _path = self.delegate_path(path)
     with unwrap_errors(path):
         return _fs.remove(_path)
示例#16
0
 def delete(self, name):
     with unwrap_errors(name):
         try:
             self.fs.remove(name)
         except ResourceNotFoundError:
             pass
示例#17
0
 def url(self, name):
     with unwrap_errors(name):
         ret = self.base_url + abspath(name)
     return ret
示例#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)
示例#19
0
 def removedir(self, path, rf=False):
     _fs, _path = self.delegate_path(path)
     with unwrap_errors(path):
         return _fs.removedir(_path)
示例#20
0
 def getmtime(self, path):
     _fs, _path = self.delegate_path(path)
     with unwrap_errors(path):
         return _fs.getmtime(_path)
示例#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)
示例#22
0
 def format_list(self, basedir, listing):
     _fs, _path = self.delegate_path(basedir)
     with unwrap_errors(basedir):
         return _fs.format_list(_path, listing)
示例#23
0
 def getmtime(self, path):
     _fs, _path = self.delegate_path(path)
     with unwrap_errors(path):
         return _fs.getmtime(_path)
示例#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)
示例#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)
示例#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)
示例#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)
示例#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)
示例#29
0
 def stat(self, path):
     _fs, _path = self.delegate_path(path)
     with unwrap_errors(path):
         return _fs.stat(_path)
示例#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)
示例#31
0
 def removedir(self, path, rf=False):
     _fs, _path = self.delegate_path(path)
     with unwrap_errors(path):
         return _fs.removedir(_path)
示例#32
0
 def stat(self, path):
     _fs, _path = self.delegate_path(path)
     with unwrap_errors(path):
         return _fs.stat(_path)
示例#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)
示例#34
0
 def size(self, name):
     with unwrap_errors(name):
         size = self.fs.getsize(name)
     return size