diff options
author | Corentin Chary <corentin.chary@gmail.com> | 2012-07-26 21:31:10 +0200 |
---|---|---|
committer | Corentin Chary <corentin.chary@gmail.com> | 2012-07-26 21:31:10 +0200 |
commit | 6dce7707c8a144f149b15740fc81b38514682b63 (patch) | |
tree | 22ced2c540ba31879d10e72799489eaa24122ae5 | |
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>
-rwxr-xr-x | bin/euscan | 3 | ||||
-rw-r--r-- | pym/euscan/out.py | 6 | ||||
-rw-r--r-- | pym/euscan/scan.py | 5 |
3 files changed, 10 insertions, 4 deletions
@@ -308,6 +308,9 @@ def main(): "for more informations" ) + if not (CONFIG['format'] or CONFIG['quiet']) and len(queries) > 1: + print("") + if CONFIG['progress']: on_progress_gen.next() print("\n", file=sys.stderr) 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 |