diff options
author | 2012-07-26 21:31:10 +0200 | |
---|---|---|
committer | 2012-07-26 21:31:10 +0200 | |
commit | 6dce7707c8a144f149b15740fc81b38514682b63 (patch) | |
tree | 22ced2c540ba31879d10e72799489eaa24122ae5 /pym | |
parent | djeuscan: use crontabs and depends on djcelery migrations (diff) | |
download | euscan-6dce7707c8a144f149b15740fc81b38514682b63.tar.gz euscan-6dce7707c8a144f149b15740fc81b38514682b63.tar.bz2 euscan-6dce7707c8a144f149b15740fc81b38514682b63.zip |
euscan: fix some \n issues
Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
Diffstat (limited to 'pym')
-rw-r--r-- | pym/euscan/out.py | 6 | ||||
-rw-r--r-- | pym/euscan/scan.py | 5 |
2 files changed, 7 insertions, 4 deletions
diff --git a/pym/euscan/out.py b/pym/euscan/out.py index 8a505fc..65947ee 100644 --- a/pym/euscan/out.py +++ b/pym/euscan/out.py @@ -37,8 +37,10 @@ class ProgressHandler(object): def progress_bar(): on_progress = None - progress_bar = TermProgressBar(title="euscan") - progress_bar.file = sys.stderr + try: + progress_bar = TermProgressBar(fd=sys.stderr, title="euscan") + except TypeError: + progress_bar = TermProgressBar(title="euscan") progress_handler = ProgressHandler(progress_bar) on_progress = progress_handler.on_progress diff --git a/pym/euscan/scan.py b/pym/euscan/scan.py index 5d9fd06..86574ae 100644 --- a/pym/euscan/scan.py +++ b/pym/euscan/scan.py @@ -169,8 +169,7 @@ def scan_upstream(query, on_progress=None): is_current_version_stable = is_version_stable(ver) if len(result) > 0: if not (CONFIG['format'] or CONFIG['quiet']): - print("\n", file=sys.stderr) - + print("") for cp, url, version, handler, confidence in result: if CONFIG["ignore-pre-release"]: if not is_version_stable(version): @@ -179,6 +178,8 @@ def scan_upstream(query, on_progress=None): if is_current_version_stable and \ not is_version_stable(version): continue + if CONFIG['progress']: + print ("", file=sys.stderr) output.result(cp, version, url, handler, confidence) return result |