archiver/util.py
def progress_bar(seconds=seconds, prefix=prefix):
        """show timer in the form of progress bar, with percentage and seconds remaining"""
        try:
            for s in range(seconds * chunks):
                progress = s / chunks / seconds * 100
                bar_width = round(progress/(100/chunks))

                # ████████████████████           0.9% (1/60sec)
                sys.stdout.write('\r{0}{1}{2}{3} {4}% ({5}/{6}sec)'.format(
                    prefix,
                    ANSI['green'],
                    (chunk * bar_width).ljust(chunks),
                    ANSI['reset'],
                    round(progress, 1),
                    round(s/chunks),
                    seconds,
                ))
                sys.stdout.flush()
                time.sleep(1 / chunks)

            # ██████████████████████████████████ 100.0% (60/60sec)
            sys.stdout.write('\r{0}{1}{2}{3} {4}% ({5}/{6}sec)\n'.format(
                prefix,
                ANSI['red'],
                chunk * chunks,
                ANSI['reset'],
                100.0,
                seconds,
                seconds,
            ))
            sys.stdout.flush()
        except KeyboardInterrupt:
            print()
            pass
show timer in the form of progress bar, with percentage and seconds remaining
show timer in the form of progress bar, with percentage and seconds remaining
show timer in the form of progress bar with percentage and seconds remaining
def progress_bar(seconds=seconds, prefix=prefix):
        try:
            for s in range(seconds * chunks):
                progress = s / chunks / seconds * 100
                bar_width = round(progress/(100/chunks))
                sys.stdout.write('\r{0}{1}{2}{3} {4}% ({5}/{6}sec)'.format(
                    prefix,
                    ANSI['green'],
                    (chunk * bar_width).ljust(chunks),
                    ANSI['reset'],
                    round(progress, 1),
                    round(s/chunks),
                    seconds,
                ))
                sys.stdout.flush()
                time.sleep(1 / chunks)
            sys.stdout.write('\r{0}{1}{2}{3} {4}% ({5}/{6}sec)\n'.format(
                prefix,
                ANSI['red'],
                chunk * chunks,
                ANSI['reset'],
                100.0,
                seconds,
                seconds,
            ))
            sys.stdout.flush()
        except KeyboardInterrupt:
            print()
            pass
def progress_bar ( seconds = seconds , prefix = prefix ) : try : for s in range ( seconds * chunks ) : progress = s / chunks / seconds * 100 bar_width = round ( progress / ( 100 / chunks ) ) sys . stdout . write ( '\r{0}{1}{2}{3} {4}% ({5}/{6}sec)' . format ( prefix , ANSI [ 'green' ] , ( chunk * bar_width ) . ljust ( chunks ) , ANSI [ 'reset' ] , round ( progress , 1 ) , round ( s / chunks ) , seconds , ) ) sys . stdout . flush ( ) time . sleep ( 1 / chunks ) sys . stdout . write ( '\r{0}{1}{2}{3} {4}% ({5}/{6}sec)\n' . format ( prefix , ANSI [ 'red' ] , chunk * chunks , ANSI [ 'reset' ] , 100.0 , seconds , seconds , ) ) sys . stdout . flush ( ) except KeyboardInterrupt : print ( ) pass
show timer in the form of progress bar, with percentage and seconds remaining
show timer in the form of progress bar with percentage and seconds remaining
"""show timer in the form of progress bar, with percentage and seconds remaining""" # ████████████████████           0.9% (1/60sec) # ██████████████████████████████████ 100.0% (60/60sec)
seconds
prefix