コード例 #1
0
ファイル: fs_utils.py プロジェクト: xushuo1/conpot
 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
ファイル: fs_utils.py プロジェクト: xushuo1/conpot
 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
ファイル: fs_utils.py プロジェクト: xushuo1/conpot
 def get_permissions(self, path):
     _fs, _path = self.delegate_path(path)
     with unwrap_errors(path):
         return _fs.get_permissions(_path)
コード例 #4
0
ファイル: fs_utils.py プロジェクト: xushuo1/conpot
 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
ファイル: fs_utils.py プロジェクト: xushuo1/conpot
 def format_list(self, basedir, listing):
     _fs, _path = self.delegate_path(basedir)
     with unwrap_errors(basedir):
         return _fs.format_list(_path, listing)
コード例 #6
0
ファイル: fs_utils.py プロジェクト: agnivesh/conpot
 def get_permissions(self, path):
     _fs, _path = self.delegate_path(path)
     with unwrap_errors(path):
         return _fs.get_permissions(_path)
コード例 #7
0
ファイル: fs_utils.py プロジェクト: agnivesh/conpot
 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
ファイル: django_storage.py プロジェクト: Splawik/pytigon
 def delete(self, name):
     with unwrap_errors(name):
         try:
             self.fs.remove(name)
         except ResourceNotFoundError:
             pass
コード例 #13
0
ファイル: django_storage.py プロジェクト: Splawik/pytigon
 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
ファイル: django_storage.py プロジェクト: Splawik/pytigon
 def _open(self, name, mode):
     with unwrap_errors(name):
         f = self.fs.open(name, mode)
     return File(f)
コード例 #15
0
ファイル: fs_utils.py プロジェクト: xushuo1/conpot
 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
ファイル: django_storage.py プロジェクト: Splawik/pytigon
 def url(self, name):
     with unwrap_errors(name):
         ret = self.base_url + abspath(name)
     return ret
コード例 #18
0
ファイル: fs_utils.py プロジェクト: agnivesh/conpot
 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
ファイル: fs_utils.py プロジェクト: agnivesh/conpot
 def removedir(self, path, rf=False):
     _fs, _path = self.delegate_path(path)
     with unwrap_errors(path):
         return _fs.removedir(_path)
コード例 #20
0
ファイル: fs_utils.py プロジェクト: agnivesh/conpot
 def getmtime(self, path):
     _fs, _path = self.delegate_path(path)
     with unwrap_errors(path):
         return _fs.getmtime(_path)
コード例 #21
0
ファイル: fs_utils.py プロジェクト: agnivesh/conpot
 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
ファイル: fs_utils.py プロジェクト: agnivesh/conpot
 def format_list(self, basedir, listing):
     _fs, _path = self.delegate_path(basedir)
     with unwrap_errors(basedir):
         return _fs.format_list(_path, listing)
コード例 #23
0
ファイル: fs_utils.py プロジェクト: xushuo1/conpot
 def getmtime(self, path):
     _fs, _path = self.delegate_path(path)
     with unwrap_errors(path):
         return _fs.getmtime(_path)
コード例 #24
0
ファイル: fs_utils.py プロジェクト: agnivesh/conpot
 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
ファイル: fs_utils.py プロジェクト: xushuo1/conpot
 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
ファイル: fs_utils.py プロジェクト: agnivesh/conpot
 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
ファイル: fs_utils.py プロジェクト: xushuo1/conpot
 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
ファイル: fs_utils.py プロジェクト: agnivesh/conpot
 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
ファイル: fs_utils.py プロジェクト: xushuo1/conpot
 def stat(self, path):
     _fs, _path = self.delegate_path(path)
     with unwrap_errors(path):
         return _fs.stat(_path)
コード例 #30
0
ファイル: fs_utils.py プロジェクト: agnivesh/conpot
 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
ファイル: fs_utils.py プロジェクト: xushuo1/conpot
 def removedir(self, path, rf=False):
     _fs, _path = self.delegate_path(path)
     with unwrap_errors(path):
         return _fs.removedir(_path)
コード例 #32
0
ファイル: fs_utils.py プロジェクト: agnivesh/conpot
 def stat(self, path):
     _fs, _path = self.delegate_path(path)
     with unwrap_errors(path):
         return _fs.stat(_path)
コード例 #33
0
ファイル: fs_utils.py プロジェクト: xushuo1/conpot
 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
ファイル: django_storage.py プロジェクト: Splawik/pytigon
 def size(self, name):
     with unwrap_errors(name):
         size = self.fs.getsize(name)
     return size