euscan: Progressbar on stderr

Signed-off-by: volpino <fox91@anche.no>
This commit is contained in:
volpino 2012-07-24 08:10:56 +02:00 committed by Corentin Chary
parent cf8f9ae9cc
commit 67654ee0b4
4 changed files with 5 additions and 2 deletions

View File

@ -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"):

View File

@ -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):

View File

@ -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

View File

@ -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