mathlibtools/lib.py
def unpack_archive(fname: Union[str, Path], tgt_dir: Union[str, Path],
                   oleans_only: bool) -> None:
    """ Alternative to `shutil.unpack_archive` that shows progress"""
    with tarfile.open(fname) as tarobj:
        if oleans_only:
            members : Iterable[tarfile.TarInfo] = (f for f in tarobj if Path(f.name).suffix == '.olean')
        else:
            members = tarobj
        tarobj.extractall(
            str(tgt_dir), members=tqdm(members, desc='  files extracted', unit=''))
 Alternative to `shutil.unpack_archive` that shows progress
Alternative to `shutil.unpack_archive` that shows progress
Alternative to ` shutil . unpack_archive ` that shows progress
def unpack_archive(fname: Union[str, Path], tgt_dir: Union[str, Path],
                   oleans_only: bool) -> None:
    with tarfile.open(fname) as tarobj:
        if oleans_only:
            members : Iterable[tarfile.TarInfo] = (f for f in tarobj if Path(f.name).suffix == '.olean')
        else:
            members = tarobj
        tarobj.extractall(
            str(tgt_dir), members=tqdm(members, desc='  files extracted', unit=''))
def unpack_archive ( fname : Union [ str , Path ] , tgt_dir : Union [ str , Path ] , oleans_only : bool ) -> None : with tarfile . open ( fname ) as tarobj : if oleans_only : members : Iterable [ tarfile . TarInfo ] = ( f for f in tarobj if Path ( f . name ) . suffix == '.olean' ) else : members = tarobj tarobj . extractall ( str ( tgt_dir ) , members = tqdm ( members , desc = '  files extracted' , unit = '' ) )
Alternative to `shutil.unpack_archive` that shows progress
Alternative to ` shutil . unpack_archive ` that shows progress
""" Alternative to `shutil.unpack_archive` that shows progress"""
fname
Union[str, Path]
tgt_dir
Union[str, Path]
oleans_only
bool