From 9d7844bb9474c2431f268061dffed0c5c49ddc7d Mon Sep 17 00:00:00 2001 From: Scott Worley Date: Mon, 18 May 2020 16:21:33 -0700 Subject: [PATCH 1/1] Status chatter goes to stderr --- pinch.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pinch.py b/pinch.py index 4a6158a..46e5af3 100644 --- a/pinch.py +++ b/pinch.py @@ -10,6 +10,7 @@ import os.path import shlex import shutil import subprocess +import sys import tempfile import types import urllib.parse @@ -58,7 +59,7 @@ class Verification: self.line_length = 0 def status(self, s: str) -> None: - print(s, end=' ', flush=True) + print(s, end=' ', file=sys.stderr, flush=True) self.line_length += 1 + len(s) # Unicode?? @staticmethod @@ -70,7 +71,7 @@ class Verification: length = len(message) cols = shutil.get_terminal_size().columns pad = (cols - (self.line_length + length)) % cols - print(' ' * pad + self._color(message, color)) + print(' ' * pad + self._color(message, color), file=sys.stderr) self.line_length = 0 if not r: raise VerificationError() -- 2.44.1