mergin/client_pull.py
def _download_items(file, directory, diff_only=False):
    """ Returns an array of download queue items """

    file_dir = os.path.dirname(os.path.normpath(os.path.join(directory, file['path'])))
    basename = os.path.basename(file['diff']['path']) if diff_only else os.path.basename(file['path'])
    file_size = file['diff']['size'] if diff_only else file['size']
    chunks = math.ceil(file_size / CHUNK_SIZE)

    items = []
    for part_index in range(chunks):
        download_file_path = os.path.join(file_dir, basename + ".{}".format(part_index))
        size = min(CHUNK_SIZE, file_size - part_index * CHUNK_SIZE)
        items.append(DownloadQueueItem(file['path'], size, file['version'], diff_only, part_index, download_file_path))

    return items
 Returns an array of download queue items 
Returns an array of download queue items
Returns an array of download queue items
def _download_items(file, directory, diff_only=False):
    file_dir = os.path.dirname(os.path.normpath(os.path.join(directory, file['path'])))
    basename = os.path.basename(file['diff']['path']) if diff_only else os.path.basename(file['path'])
    file_size = file['diff']['size'] if diff_only else file['size']
    chunks = math.ceil(file_size / CHUNK_SIZE)
    items = []
    for part_index in range(chunks):
        download_file_path = os.path.join(file_dir, basename + ".{}".format(part_index))
        size = min(CHUNK_SIZE, file_size - part_index * CHUNK_SIZE)
        items.append(DownloadQueueItem(file['path'], size, file['version'], diff_only, part_index, download_file_path))
    return items
def _download_items ( file , directory , diff_only = False ) : file_dir = os . path . dirname ( os . path . normpath ( os . path . join ( directory , file [ 'path' ] ) ) ) basename = os . path . basename ( file [ 'diff' ] [ 'path' ] ) if diff_only else os . path . basename ( file [ 'path' ] ) file_size = file [ 'diff' ] [ 'size' ] if diff_only else file [ 'size' ] chunks = math . ceil ( file_size / CHUNK_SIZE ) items = [ ] for part_index in range ( chunks ) : download_file_path = os . path . join ( file_dir , basename + ".{}" . format ( part_index ) ) size = min ( CHUNK_SIZE , file_size - part_index * CHUNK_SIZE ) items . append ( DownloadQueueItem ( file [ 'path' ] , size , file [ 'version' ] , diff_only , part_index , download_file_path ) ) return items
Returns an array of download queue items
Returns an array of download queue items
""" Returns an array of download queue items """
file
directory
diff_only