mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-04-29 15:13:22 +02:00
Use platform dependant line separator for calibredb list
This commit is contained in:
parent
a41fcfd3db
commit
d3eb47e86f
1 changed files with 3 additions and 2 deletions
|
|
@ -13,7 +13,7 @@
|
|||
from calibre.db.cli.utils import str_width
|
||||
from calibre.ebooks.metadata import authors_to_string
|
||||
from calibre.utils.date import isoformat
|
||||
from polyglot.builtins import iteritems, unicode_type, map
|
||||
from polyglot.builtins import as_bytes, iteritems, map, unicode_type
|
||||
|
||||
readonly = True
|
||||
version = 0 # change this if you change signature of implementation()
|
||||
|
|
@ -204,6 +204,7 @@ def do_list(
|
|||
with ColoredStream(sys.stdout, fg='green'):
|
||||
prints(''.join(titles))
|
||||
stdout = getattr(sys.stdout, 'buffer', sys.stdout)
|
||||
linesep = as_bytes(os.linesep)
|
||||
|
||||
wrappers = [TextWrapper(x - 1).wrap if x > 1 else lambda y: y for x in widths]
|
||||
|
||||
|
|
@ -219,7 +220,7 @@ def do_list(
|
|||
if i < len(text) - 1:
|
||||
filler = ('%*s' % (widths[i] - str_width(ft) - 1, ''))
|
||||
stdout.write((filler + separator).encode('utf-8'))
|
||||
stdout.write(b'\n')
|
||||
stdout.write(linesep)
|
||||
|
||||
|
||||
def option_parser(get_parser, args):
|
||||
|
|
|
|||
Loading…
Reference in a new issue