Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Exception handling
  • Loading branch information
Klaus Thoden committed Aug 30, 2018
1 parent d9ada9f commit 4fbaa0b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions eoatex2imxml.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
# -*- coding: utf-8; mode: python -*-
# Time-stamp: <2018-08-24 17:17:19 (kthoden)>
# Time-stamp: <2018-08-30 17:51:23 (kthoden)>

"""
Converts Latex files into a customized DocBook XML file.
Expand Down Expand Up @@ -1417,7 +1417,11 @@ def cleanup():
strTitle = current_citation["title"]

# [1:-1] to remove parentheses around citations
citeauthoryear_value = form_cit.select("#citeauthoryear ~ p > span[data-cites='%s']" % string_citekey)[0].text[1:-1]
try:
citeauthoryear_value = form_cit.select("#citeauthoryear ~ p > span[data-cites='%s']" % string_citekey)[0].text[1:-1]
except IndexError:
print("Could not find {}. Exiting.".format(string_citekey))
sys.exit()
data_title_value = citeauthoryear_value
if xmlCitation.tag == "EOAciteauthoryear":
strCitation = citeauthoryear_value
Expand Down

0 comments on commit 4fbaa0b

Please sign in to comment.