diff --git a/eoatex2imxml.py b/eoatex2imxml.py index abde979..8467561 100755 --- a/eoatex2imxml.py +++ b/eoatex2imxml.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # -*- coding: utf-8; mode: python -*- -# Time-stamp: <2018-02-13 14:25:58 (kthoden)> +# Time-stamp: <2018-03-15 14:16:56 (kthoden)> # license? __version__= "1.0" @@ -51,10 +51,9 @@ if options.CONFIG_FILE is not None: CONFIG_FILE = os.path.abspath(options.CONFIG_FILE) else: - # CONFIG_FILE = "/Users/kthoden/EOAKram/dev/EOASkripts/Skripten/eoaconvert.cfg" CONFIG_FILE = os.path.dirname(sys.argv[0]) + "/config/eoaconvert.cfg" -print("The configfile is ", CONFIG_FILE) +logging.debug("The configfile is ", CONFIG_FILE) # current biber is not compatible with this code # switch TeX distribution to TeXLive2016, diff --git a/tei2imxml.py b/tei2imxml.py index 38d1c9e..4dee701 100644 --- a/tei2imxml.py +++ b/tei2imxml.py @@ -22,17 +22,20 @@ # assign ids top to bottom for the following elements: # div1 div2 div3 note item table EOAfigure EOAequation formula theorem +CONFIG_FILE = os.path.dirname(sys.argv[0]) + os.path.sep + "config" + os.path.sep +"eoaconvert.cfg" +# Reading the configuration file +CONFIG = configparser.ConfigParser() +CONFIG.read(CONFIG_FILE) + logging.basicConfig(level=logging.INFO, format=' %(asctime)s - %(levelname)s - %(message)s') ns_tei = "http://www.tei-c.org/ns/1.0" NS_MAP = {"t" : ns_tei} TMP_DIR = os.path.expanduser("tmp_files") -CSL_FILE = "/Users/kthoden/EOAKram/dev/eoa-csl/eoa.csl" OUTPUT_DIR = os.path.expanduser("CONVERT") -# this is duplicated from libeoaconvert -dictLangFootnotes = {"it" : "Note a piè pagina", "fr" : "notes en bas de page", "de" : "Fußnoten", "en" : "Footnotes"} +CSL_FILE = CONFIG['Auxiliaries']['CSL_FILE'] def get_publication_info(xml_tree): """Query the TEI document for metadata fields.