euscan: fix some \n issues

Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
This commit is contained in:
Corentin Chary 2012-07-26 21:31:10 +02:00
parent 8d65eaea1f
commit 6dce7707c8
3 changed files with 10 additions and 4 deletions

View File

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

View File

@ -37,8 +37,10 @@ class ProgressHandler(object):
def progress_bar():
on_progress = None
try:
progress_bar = TermProgressBar(fd=sys.stderr, title="euscan")
except TypeError:
progress_bar = TermProgressBar(title="euscan")
progress_bar.file = sys.stderr
progress_handler = ProgressHandler(progress_bar)
on_progress = progress_handler.on_progress

View File

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