Skip to content
This repository has been archived by the owner on May 8, 2020. It is now read-only.

Commit

Permalink
Merge pull request #153 from stellarhoof/progress_bar
Browse files Browse the repository at this point in the history
Disable progress bar through environmental variable
  • Loading branch information
miyakogi committed Sep 27, 2018
2 parents 8cc86cc + 7fe10d3 commit 5bd85e7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pyppeteer/chromium_downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
REVISION = os.environ.get(
'PYPPETEER_CHROMIUM_REVISION', __chromium_revision__)

NO_PROGRESS_BAR = os.environ.get('PYPPETEER_NO_PROGRESS_BAR', '')
if NO_PROGRESS_BAR.lower() in ('1', 'true'):
NO_PROGRESS_BAR = True

downloadURLs = {
'linux': f'{BASE_URL}/Linux_x64/{REVISION}/chrome-linux.zip',
'mac': f'{BASE_URL}/Mac/{REVISION}/chrome-mac.zip',
Expand Down Expand Up @@ -82,7 +86,7 @@ def download_zip(url: str) -> BytesIO:
except (KeyError, ValueError, AttributeError):
total_length = 0

process_bar = tqdm(total=total_length)
process_bar = tqdm(total=total_length, file=os.devnull if NO_PROGRESS_BAR else None)

# 10 * 1024
_data = BytesIO()
Expand Down

0 comments on commit 5bd85e7

Please sign in to comment.