From 0dd3fc7f2e55e894edb780418a20501c0bb7585e Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 25 Apr 2015 13:55:02 +0530 Subject: [PATCH] calibredb list: Allow outputting the languages field as well. Fixes #1445853 [Calibredb list does not export languages](https://bugs.launchpad.net/calibre/+bug/1445853) --- src/calibre/library/cli.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/calibre/library/cli.py b/src/calibre/library/cli.py index 3b1358b1b3..7a29a482ec 100644 --- a/src/calibre/library/cli.py +++ b/src/calibre/library/cli.py @@ -21,10 +21,11 @@ from calibre.ebooks.metadata.opf2 import OPFCreator, OPF from calibre.utils.date import isoformat from calibre.utils.localization import canonicalize_lang -FIELDS = set(['title', 'authors', 'author_sort', 'publisher', 'rating', - 'timestamp', 'size', 'tags', 'comments', 'series', 'series_index', - 'formats', 'isbn', 'uuid', 'pubdate', 'cover', 'last_modified', - 'identifiers']) +FIELDS = { + 'title', 'authors', 'author_sort', 'publisher', 'rating', 'timestamp', + 'size', 'tags', 'comments', 'series', 'series_index', 'formats', 'isbn', + 'uuid', 'pubdate', 'cover', 'last_modified', 'identifiers', 'languages' +} do_notify = True def send_message(msg=''): @@ -203,8 +204,8 @@ List the books available in the calibre database. def command_list(args, dbpath): pre = get_parser('') - pargs = [x for x in args if x.startswith('--with-library') or x.startswith('--library-path') - or not x.startswith('-')] + pargs = [x for x in args if x.startswith('--with-library') or x.startswith('--library-path') or + not x.startswith('-')] opts = pre.parse_args(sys.argv[:1] + pargs)[0] db = get_db(dbpath, opts) parser = list_option_parser(db=db) @@ -1318,6 +1319,7 @@ def command_restore_database(args, dbpath): dbpath = dbpath.decode(preferred_encoding) class Progress(object): + def __init__(self): self.total = 1 @@ -1555,4 +1557,3 @@ def main(args=sys.argv): if __name__ == '__main__': sys.exit(main()) -