Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add fields for ISBNs for other formats
  • Loading branch information
kthoden committed Sep 25, 2020
1 parent 776194e commit 13dbde7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/tei2imxml.py
Expand Up @@ -239,7 +239,9 @@ def get_field(xml_tree, query_path, mandatory=False, findall=False, noformat=Fal

# Optional (according to database schema)
info_dict['eoa_subtitle'] = get_field(xml_tree, "//t:teiHeader/t:fileDesc/t:titleStmt/t:title[@type='sub']/text()")
info_dict['eoa_isbn'] = get_field(xml_tree, "//t:teiHeader/t:fileDesc/t:publicationStmt/t:idno[@type='isbn']/text()")
info_dict['eoa_isbnprint'] = get_field(xml_tree, "//t:teiHeader/t:fileDesc/t:publicationStmt/t:idno[@type='isbn']/text()")
info_dict['eoa_isbnpdf'] = get_field(xml_tree, "//t:teiHeader/t:fileDesc/t:publicationStmt/t:idno[@type='isbnpdf']/text()")
info_dict['eoa_isbnepub'] = get_field(xml_tree, "//t:teiHeader/t:fileDesc/t:publicationStmt/t:idno[@type='isbnepub']/text()")
info_dict['eoa_price'] = get_field(xml_tree, "//t:teiHeader/t:fileDesc/t:extent/t:measure[@type='price']/@quantity")
info_dict['eoa_pages'] = get_field(xml_tree, "//t:teiHeader/t:fileDesc/t:extent/t:measure[@commodity='pages']/@quantity")
info_dict['eoa_currency'] = get_field(xml_tree, "//t:teiHeader/t:fileDesc/t:extent/t:measure[@type='price']/@unit")
Expand Down Expand Up @@ -288,7 +290,9 @@ def make_publication_cfg(info_dict, translation_file):
technical_config['Subtitle'] = info_dict['eoa_subtitle'] #ok
technical_config['PublicationDate'] = info_dict['eoa_publicationdate'] #ok
technical_config['PublicationYear'] = datetime.strftime(date_object, "%Y")
technical_config['ISBN'] = info_dict['eoa_isbn'] #ok
technical_config['ISBN-print'] = info_dict['eoa_isbnprint'] #ok
technical_config['ISBN'] = info_dict['eoa_isbnpdf']
technical_config['ISBN-epub'] = info_dict['eoa_isbnepub']
technical_config['Price'] = "{} {}".format(info_dict['eoa_price'], info_dict['eoa_currency'])
technical_config['Shoplink'] = """<a href="{0}">{1}</a>""".format(info_dict['eoa_shoplink_url'], info_dict['eoa_shoplink_text']) #ok
technical_config['Language'] = info_dict['eoa_language'] #ok
Expand Down

0 comments on commit 13dbde7

Please sign in to comment.