diff --git a/src/fix_tei.py b/src/fix_tei.py index 5dcd820..84fb441 100755 --- a/src/fix_tei.py +++ b/src/fix_tei.py @@ -37,7 +37,7 @@ import pickle import subprocess from lxml import etree -from datetime import datetime +import datetime import bibtexparser import argparse import traceback @@ -467,7 +467,9 @@ def fix_tei_header(xml_tree, bibfile_string, bibtype): edition_date = edition.find("t:date", namespaces=NS_MAP) edition_date.clear() edition_date.tag = "tagtobestripped" - edition.text = "First published {} by {}".format(datetime.now().strftime("%Y"), BOILERPLATES.get("Header","eoa_name")) + # projecting release date half a year from begin of production + publication_date = datetime.datetime.now() + datetime.timedelta(days=180) + edition.text = "First published {} by {}".format(publication_date.strftime("%Y"), BOILERPLATES.get("Header","eoa_name")) publication_statement = xml_tree.xpath("//t:publicationStmt", namespaces=NS_MAP)[0] unknown_paragraph = publication_statement.find("t:p", namespaces=NS_MAP) @@ -487,7 +489,7 @@ def fix_tei_header(xml_tree, bibfile_string, bibtype): publishing_org = etree.SubElement(publisher_element, "orgName", n="Press", ref=BOILERPLATES.get("Header","mprl_url")) publishing_org.text = BOILERPLATES.get("Header","mprl_name") - pub_date = etree.SubElement(publication_statement, "date", when=datetime.now().strftime("%Y-%m-%d")) + pub_date = etree.SubElement(publication_statement, "date", when=publication_date.strftime("%Y-%m-%d")) availability = etree.SubElement(publication_statement, "availability") licence = etree.SubElement(availability, "licence", target=BOILERPLATES.get("Header","licence_url")) licence.text = BOILERPLATES.get("Header","licence_text")