Skip to content

Commit

Permalink
minor to 1.8
Browse files Browse the repository at this point in the history
  • Loading branch information
linxOD committed Jun 22, 2022
1 parent c2eaa70 commit 6d1236e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 14 deletions.
2 changes: 1 addition & 1 deletion freud_api_crawler/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

__author__ = """Peter Andorfer"""
__email__ = 'peter.andorfer@oeaw.ac.at'
__version__ = '1.8.1'
__version__ = '1.8.2'
27 changes: 15 additions & 12 deletions freud_api_crawler/freud_api_crawler.py
Original file line number Diff line number Diff line change
Expand Up @@ -446,17 +446,19 @@ def make_xml(self, save=False, limit=True):
except KeyError or TypeError:
return
try:
bibl_title = ET.Element("{http://www.tei-c.org/ns/1.0}title")
bibl_title.attrib['type'] = "short"
bibl_title.text = f"{self.publication['data']['attributes']['field_shorttitle']['value']}"
bibl.append(bibl_title)
if self.publication['data']['attributes']['field_shorttitle'] is not None:
bibl_title = ET.Element("{http://www.tei-c.org/ns/1.0}title")
bibl_title.attrib['type'] = "short"
bibl_title.text = f"{self.publication['data']['attributes']['field_shorttitle']['value']}"
bibl.append(bibl_title)
except KeyError or TypeError:
return
try:
bibl_title = ET.Element("{http://www.tei-c.org/ns/1.0}title")
bibl_title.attrib['type'] = "main"
bibl_title.text = f"{self.publication['data']['attributes']['field_titel']['value']}"
bibl.append(bibl_title)
if self.publication['data']['attributes']['field_titel'] is not None:
bibl_title = ET.Element("{http://www.tei-c.org/ns/1.0}title")
bibl_title.attrib['type'] = "main"
bibl_title.text = f"{self.publication['data']['attributes']['field_titel']['value']}"
bibl.append(bibl_title)
except KeyError or TypeError:
return
try:
Expand All @@ -469,10 +471,11 @@ def make_xml(self, save=False, limit=True):
except KeyError or TypeError:
return
try:
bibl_date = ET.Element("{http://www.tei-c.org/ns/1.0}date")
bibl_date.attrib['when'] = f"{self.publication['data']['attributes']['field_publication_year']}"
bibl_date.text = f"{self.publication['data']['attributes']['field_publication_year']}"
bibl.append(bibl_date)
if self.publication['data']['attributes']['field_publication_year'] is not None:
bibl_date = ET.Element("{http://www.tei-c.org/ns/1.0}date")
bibl_date.attrib['when'] = f"{self.publication['data']['attributes']['field_publication_year']}"
bibl_date.text = f"{self.publication['data']['attributes']['field_publication_year']}"
bibl.append(bibl_date)
except KeyError or TypeError:
return
try:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,6 @@
test_suite='tests',
tests_require=test_requirements,
url='https://github.com/acdh-oeaw/freud_api_crawler',
version='1.8.1',
version='1.8.2',
zip_safe=False,
)

0 comments on commit 6d1236e

Please sign in to comment.