From e049ee7b22a7acbb5c6a941e6a4c31c9be4bb834 Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Fri, 7 Feb 2014 15:05:41 +0100 Subject: [PATCH] Fix some errors in scripts. --- librarian/text.py | 2 ++ scripts/book2html | 2 +- scripts/book2pdf | 2 +- scripts/book2txt | 9 +++++++-- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/librarian/text.py b/librarian/text.py index 9a4fd7a..d965a47 100644 --- a/librarian/text.py +++ b/librarian/text.py @@ -45,6 +45,8 @@ def transform(wldoc, flags=None, **options): if flags: for flag in flags: document.edoc.getroot().set(flag, 'yes') + if 'wrapping' in options: + options['wrapping'] = str(options['wrapping']) result = document.transform(style, **options) diff --git a/scripts/book2html b/scripts/book2html index 5d48eec..2c1d04e 100755 --- a/scripts/book2html +++ b/scripts/book2html @@ -17,7 +17,7 @@ class Book2Html(Book2Anything): action='store_false', default=True, help='output raw text for use in templates') ] - parser_args = [ + parser_options = [ Option('-i', '--ignore-dublin-core', dest='parse_dublincore', action='store_false', default=True, help='don\'t try to parse dublin core metadata') diff --git a/scripts/book2pdf b/scripts/book2pdf index 68e2d08..ccb5fac 100755 --- a/scripts/book2pdf +++ b/scripts/book2pdf @@ -12,7 +12,7 @@ class Book2Pdf(Book2Anything): ext = "pdf" uses_cover = True uses_provider = True - transform_args = [ + transform_options = [ Option('-t', '--save-tex', dest='save_tex', metavar='FILE', help='path to save the intermediary LaTeX file to'), Option('-m', '--morefloats', dest='morefloats', metavar='old/new/none', diff --git a/scripts/book2txt b/scripts/book2txt index 1b4c0ef..c706a07 100755 --- a/scripts/book2txt +++ b/scripts/book2txt @@ -13,15 +13,20 @@ class Book2Txt(Book2Anything): ext = "txt" uses_cover = False uses_provider = False - parser_args = [ + parser_options = [ Option('-i', '--ignore-dublin-core', dest='parse_dublincore', action='store_false', default=True, help='don\'t try to parse dublin core metadata') ] - transform_args = [ + transform_options = [ Option('-w', '--wrap', action='store', type='int', dest='wrapping', default=0, help='set line wrap column') ] + transform_flags = [ + Option('-r', '--raw', dest='raw-text', + action='store_true', default=False, + help='Produce raw text, without any surrounding info.') + ] transform = WLDocument.as_text -- 2.20.1