1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-11-13 07:56:14 +01:00

check if stdout is a tty before call pager

Check if stdout is a tty before call pager otherwise simply
print the text out.

Signed-off-by: Danny Kukawka <danny.kukawka@web.de>
This commit is contained in:
Danny Kukawka 2010-05-03 18:04:26 +02:00 committed by Ludwig Nussel
parent 5a19362570
commit 23274b58d4

View File

@ -2481,8 +2481,11 @@ def read_meta_from_spec(specfile, *args):
return spec_data
def run_pager(message):
import tempfile
import tempfile, sys
if not sys.stdout.isatty:
print message
else:
tmpfile = None
if tmpfile is None: