Skip to content

Commit

Permalink
Merge pull request #40 from slub/issue_0039
Browse files Browse the repository at this point in the history
Use "licence" for all types of licences (even unknown ones)
  • Loading branch information
wrznr authored Apr 29, 2020
2 parents 1365a7c + f9901cb commit 0590a85
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions mets_mods2tei/api/tei.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,25 +435,23 @@ def set_availability(self, status, licence_text, licence_url):
else:
availability = etree.SubElement(publication_stmt, "%savailability" % TEI)

licence = etree.SubElement(availability, "%slicence" % TEI)
if licence_url != "":
licence.set("target", licence_url)
# an explicit licence has been set
if status == "licence" and licence_text != "":
availability.set("status", "licenced")
licence = etree.SubElement(availability, "%slicence" % TEI)
licence.text = licence_text
if licence_url != "":
licence.set("target", licence_url)
# public domain
elif status == "free":
note = etree.SubElement(availability, "%sp" % TEI)
note.text = "In the public domain"
licence.text = "In the public domain"
availability.set("status", "free")
elif status == "unknown":
availability.set("status", "unknown")
# use restricted as default
else:
availability.set("status", "restricted")
note = etree.SubElement(availability, "%sp" % TEI)
note.text = "Available under licence from the publishers."
licence.text = "Available under licence from the publishers."

def add_encoding_date(self, date):
"""
Expand Down

0 comments on commit 0590a85

Please sign in to comment.