Rollback ui.print_() auto-conv of args to string

Since this raises problems the best is probably to maintain the base
behaviour: expect byte strings or unicodes.
This commit is contained in:
Bruno Cauet 2015-01-26 23:47:12 +01:00
parent 4e904c78af
commit 4aba4320e6
2 changed files with 2 additions and 8 deletions

View file

@ -102,12 +102,6 @@ def print_(*strings):
either bytes or unicode.
"""
if strings:
if not isinstance(strings[0], basestring):
try:
strings = map(unicode, strings)
except UnicodeError:
strings = map(bytes, strings)
if isinstance(strings[0], unicode):
txt = u' '.join(strings)
else:
@ -571,7 +565,7 @@ def show_model_changes(new, old=None, fields=None, always=False):
# Print changes.
if changes or always:
print_(old)
print_(format(old))
if changes:
print_(u'\n'.join(changes))

View file

@ -994,7 +994,7 @@ def update_items(lib, query, album, move, pretend):
for item in items:
# Item deleted?
if not os.path.exists(syspath(item.path)):
ui.print_(item)
ui.print_(format(item))
ui.print_(ui.colorize('red', u' deleted'))
if not pretend:
item.remove(True)