From 67654ee0b4da40741e2eb0a6d9c00d823a2031c5 Mon Sep 17 00:00:00 2001 From: volpino Date: Tue, 24 Jul 2012 08:10:56 +0200 Subject: [PATCH] euscan: Progressbar on stderr Signed-off-by: volpino --- bin/euscan | 3 ++- euscanwww/djeuscan/processing/scan/scan_portage.py | 1 + euscanwww/djeuscan/tests/__init__.py | 1 - pym/euscan/out.py | 2 ++ 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/bin/euscan b/bin/euscan index eb637d1..47bb7b4 100755 --- a/bin/euscan +++ b/bin/euscan @@ -35,6 +35,7 @@ from euscan import CONFIG, output # Globals isatty = os.environ.get('TERM') != 'dumb' and sys.stdout.isatty() +isatty_stderr = os.environ.get('TERM') != 'dumb' and sys.stderr.isatty() def exit_helper(status): @@ -183,7 +184,7 @@ def parse_args(): CONFIG['nocolor'] = True pp.output.nocolor() elif o in ("-p", "--progress"): - CONFIG['progress'] = isatty + CONFIG['progress'] = isatty_stderr elif o in ("--mirror"): CONFIG['mirror'] = True elif o in ("-i", "--ignore-pre-release"): diff --git a/euscanwww/djeuscan/processing/scan/scan_portage.py b/euscanwww/djeuscan/processing/scan/scan_portage.py index 79fa62a..f4ca15d 100644 --- a/euscanwww/djeuscan/processing/scan/scan_portage.py +++ b/euscanwww/djeuscan/processing/scan/scan_portage.py @@ -13,6 +13,7 @@ from euscan.version import get_version_type from djeuscan.processing import FakeLogger from djeuscan.models import Package, Version, VersionLog + class ScanPortage(object): def __init__(self, logger=None, no_log=False, purge_packages=False, purge_versions=False): diff --git a/euscanwww/djeuscan/tests/__init__.py b/euscanwww/djeuscan/tests/__init__.py index 5e37ff2..78a1082 100644 --- a/euscanwww/djeuscan/tests/__init__.py +++ b/euscanwww/djeuscan/tests/__init__.py @@ -3,7 +3,6 @@ from urllib import urlencode from django.test import TestCase from django.test.client import Client from django.core.urlresolvers import reverse -from django.contrib.auth.models import User from djeuscan.tests.euscan_factory import UserFactory diff --git a/pym/euscan/out.py b/pym/euscan/out.py index c0ed61b..8a505fc 100644 --- a/pym/euscan/out.py +++ b/pym/euscan/out.py @@ -1,3 +1,4 @@ +import sys from io import StringIO from collections import defaultdict import json @@ -37,6 +38,7 @@ class ProgressHandler(object): def progress_bar(): on_progress = None progress_bar = TermProgressBar(title="euscan") + progress_bar.file = sys.stderr progress_handler = ProgressHandler(progress_bar) on_progress = progress_handler.on_progress