]> git.scottworley.com Git - pinch/commitdiff
Status chatter goes to stderr
authorScott Worley <scottworley@scottworley.com>
Mon, 18 May 2020 23:21:33 +0000 (16:21 -0700)
committerScott Worley <scottworley@scottworley.com>
Mon, 18 May 2020 23:21:33 +0000 (16:21 -0700)
pinch.py

index 4a6158adb7a7907537d10a9f5273ccc6bd2fafc3..46e5af30f9111043827bab3089040c1acaf1699f 100644 (file)
--- 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()