Skip to content

Commit

Permalink
Don't show meter in terminals that are not interactive
Browse files Browse the repository at this point in the history
  • Loading branch information
dmach committed Jan 24, 2024
1 parent 7d6eebe commit 76a5432
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion osc/meter.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@


import signal
import sys
from abc import ABC
from abc import abstractmethod
from typing import Optional
Expand Down Expand Up @@ -77,7 +78,7 @@ def create_text_meter(*args, **kwargs) -> TextMeterBase:
kwargs.pop("use_pb_fallback", True)

meter_class = PBTextMeter
if not have_pb_module or config.quiet or not config.show_download_progress:
if not have_pb_module or config.quiet or not config.show_download_progress or not sys.stdout.isatty():
meter_class = NoPBTextMeter

return meter_class(*args, **kwargs)
Expand Down

0 comments on commit 76a5432

Please sign in to comment.