def report_bar(bytes_so_far, total_size, speed, eta):
percent = int(bytes_so_far * <NUM_LIT:100> / total_size)<EOL>current = approximate_size(bytes_so_far).center(<NUM_LIT:9>)<EOL>total = approximate_size(total_size).center(<NUM_LIT:9>)<EOL>shaded = int(float(bytes_so_far) / total_size * AVAIL_WIDTH)<EOL>sys.stdout.write(<EOL>"<STR_LIT>".format(str(percent).center(<NUM_LIT:4>),<EOL>'<STR_LIT:=>' * (shaded - <NUM_LIT:1>),<EOL>'<STR_LIT:>>',<EOL>'<STR_LIT:U+0020>' * (AVAIL_WIDTH - shaded),<EOL>current,<EOL>total,<EOL>(approximate_size(speed) + '<STR_LIT>').center(<NUM_LIT:11>),<EOL>eta.center(<NUM_LIT:10>)))<EOL>sys.stdout.write("<STR_LIT:\r>")<EOL>sys.stdout.flush()<EOL>
This callback for the download function is used to print the download bar