if lib.tqdm_avail:
# A nice progress bar but read/write instead of copyfileobj slows it down a little.
total_size = int(r.headers.get('content-length', 0))
- progress_bar = lib.tqdm(desc="download", total=total_size, unit='iB', unit_scale=True)
+ progress_bar = lib.tqdm(desc="download", total=total_size, unit='iB', unit_scale=True, leave=False)
with open(input_path, 'wb') as f:
for data in r.iter_content(100000):
f.write(data)
# Extract the text from each (single-threaded)
# INPUT.pdf -> INPUT.pdf.txt
with lib.timer("pdftotext", logging.warning):
- for pdf in lib.tqdm(pdfs, desc="pdftotext"):
+ for pdf in lib.tqdm(pdfs, desc="pdftotext", leave=False):
input_pdf = os.path.join(td_in, pdf)
output_txt = os.path.join(td_out, pdf + ".txt")
#logging.info("converting {} -> {}".format(input_pdf, output_txt))