From 7497febae81525dc928a64a30fe47cc7b5402836 Mon Sep 17 00:00:00 2001 From: Klaus Thoden Date: Mon, 5 Mar 2018 13:16:49 +0100 Subject: [PATCH] argparse arguments --- prepare_tei.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/prepare_tei.py b/prepare_tei.py index e613b79..a7e5a74 100644 --- a/prepare_tei.py +++ b/prepare_tei.py @@ -283,8 +283,8 @@ def main(): parser = argparse.ArgumentParser() parser.add_argument("teifile", help="Output from oxgarage/metypeset, an TEI XML file.") - parser-add_argument("bibfile", help="The bibliography database of the publication.") - parser-add_argument("figdir", help="The directory that contains the figures belonging to the publication.") + parser.add_argument("bibfile", help="The bibliography database of the publication.") + parser.add_argument("figdir", help="The directory that contains the figures belonging to the publication.") args = parser.parse_args() with open(args.teifile, 'r') as xmlfile: @@ -357,7 +357,7 @@ def main(): fix_document_structure(xml_tree2) # output - output = teifile.replace(".xml", "-out.xml") + output = args.teifile.replace(".xml", "-out.xml") tree = etree.ElementTree(xml_tree2) tree.write(output, pretty_print=True, xml_declaration=True,encoding="utf-8") logging.info("Wrote %s." % output)