View Single Post
Old 02-04-2014, 06:48 AM   #1
ZioNemo
Enthusiast
ZioNemo began at the beginning.
 
Posts: 48
Karma: 10
Join Date: Mar 2008
Device: HTC-p3000
calibredb exception

Hi,
I'm writing a tool to automate lib management & transfer between different databases (BookCAT, in my case).
As directed I'm using calibredb to interact with Calibre database.
Basic creation of books in Calibre works
To handle updating I need to query what books are already there and their ID.
To have a better matching I wanted to use optional fields (e.g.: ISBN), but it seems calibredb chokes when one requested field is empty.


Code:
$ calibredb list  --separator='|' --fields=title,authors,isbn
id|title                   |authors      |isbn|
Traceback (most recent call last):
  File "site.py", line 58, in main
  File "site-packages/calibre/library/cli.py", line 1475, in main
  File "site-packages/calibre/library/cli.py", line 221, in command_list
  File "site-packages/calibre/library/cli.py", line 138, in do_list
  File "textwrap.py", line 329, in wrap
  File "textwrap.py", line 258, in _wrap_chunks
ValueError: invalid width 0 (must be > 0)
$ calibredb list  --separator='|' --fields=title,authors
id|title                    |authors      |
1|Calibre Quick Start Guide|John Schember|
Is this intentional? If so: how can I work around this?
I'm currently using "calibredb (calibre 1.20)" on Debian Linux (wheezy).
I know it's not the latest, but it should be recent enough, isn't it?

TiA
ZioNemo is offline   Reply With Quote