mergin/client_pull.py
def download_blocking(self, mc, mp, project_path):
        """ Starts download and only returns once the file has been fully downloaded and saved """

        mp.log.debug(f"Downloading {self.file_path} version={self.version} diff={self.diff_only} part={self.part_index}")
        start = self.part_index * (1 + CHUNK_SIZE)
        resp = mc.get("/v1/project/raw/{}".format(project_path), data={
                "file": self.file_path,
                "version": self.version,
                "diff": self.diff_only
            }, headers={
                "Range": "bytes={}-{}".format(start, start + CHUNK_SIZE)
            }
        )
        if resp.status in [200, 206]:
            mp.log.debug(f"Download finished: {self.file_path}")
            save_to_file(resp, self.download_file_path)
        else:
            mp.log.error(f"Download failed: {self.file_path}")
            raise ClientError('Failed to download part {} of file {}'.format(self.part_index, self.file_path))
 Starts download and only returns once the file has been fully downloaded and saved 
Starts download and only returns once the file has been fully downloaded and saved
Starts download and only returns once the file has been fully downloaded and saved
def download_blocking(self, mc, mp, project_path):
        mp.log.debug(f"Downloading {self.file_path} version={self.version} diff={self.diff_only} part={self.part_index}")
        start = self.part_index * (1 + CHUNK_SIZE)
        resp = mc.get("/v1/project/raw/{}".format(project_path), data={
                "file": self.file_path,
                "version": self.version,
                "diff": self.diff_only
            }, headers={
                "Range": "bytes={}-{}".format(start, start + CHUNK_SIZE)
            }
        )
        if resp.status in [200, 206]:
            mp.log.debug(f"Download finished: {self.file_path}")
            save_to_file(resp, self.download_file_path)
        else:
            mp.log.error(f"Download failed: {self.file_path}")
            raise ClientError('Failed to download part {} of file {}'.format(self.part_index, self.file_path))
def download_blocking ( self , mc , mp , project_path ) : mp . log . debug ( f"Downloading {self.file_path} version={self.version} diff={self.diff_only} part={self.part_index}" ) start = self . part_index * ( 1 + CHUNK_SIZE ) resp = mc . get ( "/v1/project/raw/{}" . format ( project_path ) , data = { "file" : self . file_path , "version" : self . version , "diff" : self . diff_only } , headers = { "Range" : "bytes={}-{}" . format ( start , start + CHUNK_SIZE ) } ) if resp . status in [ 200 , 206 ] : mp . log . debug ( f"Download finished: {self.file_path}" ) save_to_file ( resp , self . download_file_path ) else : mp . log . error ( f"Download failed: {self.file_path}" ) raise ClientError ( 'Failed to download part {} of file {}' . format ( self . part_index , self . file_path ) )
Starts download and only returns once the file has been fully downloaded and saved
Starts download and only returns once the file has been fully downloaded and saved
""" Starts download and only returns once the file has been fully downloaded and saved """
self
mc
mp
project_path