Skip to content

Commit

Permalink
Release date is fix date + half a year
Browse files Browse the repository at this point in the history
  • Loading branch information
kthoden committed Jan 28, 2020
1 parent 9a768af commit e868cf4
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/fix_tei.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
import pickle
import subprocess
from lxml import etree
from datetime import datetime
import datetime
import bibtexparser
import argparse
import traceback
Expand Down Expand Up @@ -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)
Expand All @@ -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")
Expand Down

0 comments on commit e868cf4

Please sign in to comment.