def read_file_chunks(
        file_path: str,
        chunk_size: int = DEFAULT_CHUNK_SIZE
) -> bytes:
    """
    Reads the specified file in chunks and returns a generator where
    each returned chunk is a compressed base64 encoded string for sync
    transmission

    :param file_path:
        The path to the file to read in chunks
    :param chunk_size:
        The size, in bytes, of each chunk. The final chunk will be less than
        or equal to this size as the remainder.
    """
    chunk_count = get_file_chunk_count(file_path, chunk_size)

    if chunk_count < 1:
        return ''

    with open(file_path, mode='rb') as fp:
        for chunk_index in range(chunk_count):
            source = fp.read(chunk_size)
            chunk = pack_chunk(source)
            yield chunk
def read_file_chunks ( file_path : str , chunk_size : int = DEFAULT_CHUNK_SIZE ) -> bytes : chunk_count = get_file_chunk_count ( file_path , chunk_size ) if chunk_count < 1 : return '' with open ( file_path , mode = 'rb' ) as fp : for chunk_index in range ( chunk_count ) : source = fp . read ( chunk_size ) chunk = pack_chunk ( source ) yield chunk
Reads the specified file in chunks and returns a generator where
    each returned chunk is a compressed base64 encoded string for sync
    transmission

    :param file_path:
        The path to the file to read in chunks
    :param chunk_size:
        The size, in bytes, of each chunk. The final chunk will be less than
        or equal to this size as the remainder.