index: Use ctx.ui.info() instead of plain print
This commit is contained in:
+5
-7
@@ -114,7 +114,7 @@ class Index(xmlfile.XmlFile):
|
|||||||
if fn == 'groups.xml':
|
if fn == 'groups.xml':
|
||||||
self.groups.extend(add_groups(os.path.join(root, fn)))
|
self.groups.extend(add_groups(os.path.join(root, fn)))
|
||||||
|
|
||||||
print
|
ctx.ui.info("")
|
||||||
|
|
||||||
# Create a process pool, as many processes as the number of CPUs we
|
# Create a process pool, as many processes as the number of CPUs we
|
||||||
# have
|
# have
|
||||||
@@ -132,7 +132,7 @@ class Index(xmlfile.XmlFile):
|
|||||||
# not using CLI, you must handle KeyboardException yourself)
|
# not using CLI, you must handle KeyboardException yourself)
|
||||||
pool.terminate()
|
pool.terminate()
|
||||||
pool.join()
|
pool.join()
|
||||||
print
|
ctx.ui.info("")
|
||||||
raise
|
raise
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@@ -162,15 +162,13 @@ class Index(xmlfile.XmlFile):
|
|||||||
except:
|
except:
|
||||||
pool.terminate()
|
pool.terminate()
|
||||||
pool.join()
|
pool.join()
|
||||||
print
|
ctx.ui.info("")
|
||||||
raise
|
raise
|
||||||
|
|
||||||
|
ctx.ui.info("")
|
||||||
pool.close()
|
pool.close()
|
||||||
pool.join()
|
pool.join()
|
||||||
|
|
||||||
# Clean up output
|
|
||||||
ctx.ui.info("\r%-80.80s" % (_('Done.')))
|
|
||||||
|
|
||||||
def add_package(params):
|
def add_package(params):
|
||||||
try:
|
try:
|
||||||
path, deltas, repo_uri = params
|
path, deltas, repo_uri = params
|
||||||
@@ -190,7 +188,7 @@ def add_package(params):
|
|||||||
# check package semantics
|
# check package semantics
|
||||||
errs = md.errors()
|
errs = md.errors()
|
||||||
if md.errors():
|
if md.errors():
|
||||||
print
|
ctx.ui.info("")
|
||||||
ctx.ui.error(_('Package %s: metadata corrupt, skipping...') % md.package.name)
|
ctx.ui.error(_('Package %s: metadata corrupt, skipping...') % md.package.name)
|
||||||
ctx.ui.error(unicode(Error(*errs)))
|
ctx.ui.error(unicode(Error(*errs)))
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user