From 73eebf2286061d64ef4bb06c57f9b3fcad59b8ba Mon Sep 17 00:00:00 2001 From: Klaus Thoden Date: Mon, 5 Mar 2018 16:23:57 +0100 Subject: [PATCH] additional report code --- prepare_tei.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/prepare_tei.py b/prepare_tei.py index fccf00c..e5a424a 100644 --- a/prepare_tei.py +++ b/prepare_tei.py @@ -322,6 +322,8 @@ def main(): with open(args.teifile, 'r') as xmlfile: xml_tree = etree.parse(xmlfile) + report = {} + ################ # bibliography # ################ @@ -337,7 +339,9 @@ def main(): mod_string, cited = convert_citations(xml_string) used_citekeys = [unescape(c[1]) for c in cited] - validate_citations(used_citekeys, bibdata) + not_cited = validate_citations(used_citekeys, bibdata) + + report["not_cited"] = not_cited mod_string2 = convert_figures(mod_string) @@ -392,7 +396,8 @@ def main(): 'tabdict' : dictTables, 'pagelabeldict' : dictPagelabels} - + if not os.path.exists("tmp_files/"): + os.makedirs(os.path.expanduser("tmp_files/")) with open('tmp_files/data.pickle', 'wb') as f: # Pickle the 'data' dictionary using the highest protocol available.