mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-06 05:13:02 +02:00
calibredb list: Fix error if one of the requested fields if empty for all requested books
This commit is contained in:
parent
3ff7f39b4b
commit
2e608ed179
1 changed files with 2 additions and 2 deletions
|
|
@ -131,11 +131,11 @@ def str_width(x):
|
|||
with ColoredStream(sys.stdout, fg='green'):
|
||||
print ''.join(titles)
|
||||
|
||||
wrappers = map(lambda x: TextWrapper(x-1), widths)
|
||||
wrappers = [TextWrapper(x - 1).wrap if x > 1 else lambda y: y for x in widths]
|
||||
o = cStringIO.StringIO()
|
||||
|
||||
for record in data:
|
||||
text = [wrappers[i].wrap(unicode(record[field])) for i, field in enumerate(fields)]
|
||||
text = [wrappers[i](unicode(record[field])) for i, field in enumerate(fields)]
|
||||
lines = max(map(len, text))
|
||||
for l in range(lines):
|
||||
for i, field in enumerate(text):
|
||||
|
|
|
|||
Loading…
Reference in a new issue