예제 #1
0
 def get_file_size(self, path: PATH_TYPES) -> int:
     """Return the file size of provided path."""
     if not isinstance(path, pathlib.Path):
         path = pathlib.Path(path)
     return path.stat().st_size
예제 #2
0
 def get_upload_time(self, path: PATH_TYPES) -> datetime.datetime:
     if not isinstance(path, pathlib.Path):
         path = pathlib.Path(path)
     return datetime.datetime.fromtimestamp(path.stat().st_mtime,
                                            datetime.timezone.utc)
예제 #3
0
파일: s3.py 프로젝트: pypa/bandersnatch
 def get_file_size(self, path: PATH_TYPES) -> int:
     if not isinstance(path, self.PATH_BACKEND):
         path = self.PATH_BACKEND(path)
     return int(path.stat().st_size)