mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
py3: Fix calibredb list
Fixes #1863470 [[python3] calibredb list fails](https://bugs.launchpad.net/calibre/+bug/1863470)
This commit is contained in:
parent
14a803229f
commit
1d35b78601
@ -203,6 +203,7 @@ def do_list(
|
||||
)
|
||||
with ColoredStream(sys.stdout, fg='green'):
|
||||
prints(''.join(titles))
|
||||
stdout = getattr(sys.stdout, 'buffer', sys.stdout)
|
||||
|
||||
wrappers = [TextWrapper(x - 1).wrap if x > 1 else lambda y: y for x in widths]
|
||||
|
||||
@ -214,10 +215,10 @@ def do_list(
|
||||
for l in range(lines):
|
||||
for i, field in enumerate(text):
|
||||
ft = text[i][l] if l < len(text[i]) else u''
|
||||
sys.stdout.write(ft.encode('utf-8'))
|
||||
stdout.write(ft.encode('utf-8'))
|
||||
if i < len(text) - 1:
|
||||
filler = (u'%*s' % (widths[i] - str_width(ft) - 1, u''))
|
||||
sys.stdout.write((filler + separator).encode('utf-8'))
|
||||
stdout.write((filler + separator).encode('utf-8'))
|
||||
print()
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user