From: Scott Worley Date: Mon, 18 May 2020 23:21:33 +0000 (-0700) Subject: Status chatter goes to stderr X-Git-Tag: 1.2~4 X-Git-Url: http://git.scottworley.com/pinch/commitdiff_plain/9d7844bb9474c2431f268061dffed0c5c49ddc7d Status chatter goes to stderr --- 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()