Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Code cleanup
  • Loading branch information
Klaus Thoden committed Sep 4, 2018
1 parent 017e257 commit 8c6d165
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions tei2imxml.py
Expand Up @@ -187,7 +187,7 @@ def make_publication_cfg(info_dict):
number_of_editors = len(info_dict['eoa_editors'])

if number_of_authors > 0 and number_of_editors > 0:
print("Found both editor and authors. This is not permitted. Exiting", number_of_authors, number_of_editors)
print("Found both editor and authors. This is not permitted. Exiting")
sys.exit()
elif number_of_authors == 0 and number_of_editors == 0:
print("Found neither editor nor authors. Please fill in. Exiting")
Expand All @@ -200,8 +200,6 @@ def make_publication_cfg(info_dict):
elif number_of_authors in range(1,6) and number_of_editors == 0:
EDITED_VOLUME = False
else:
print("num authors: ", number_of_authors)
print("num editors: ", number_of_editors)
print("Something went wrong with the number of authors end editors. Please check. Exiting")
sys.exit()

Expand Down Expand Up @@ -286,8 +284,6 @@ def format_reference_list(used_citekeys, html_file):
def format_citations(used_citekeys, bibdata, html_file):
"""Return a formatted entry of the used citations"""

# print(used_citekeys)

with open(TMP_DIR + os.path.sep + html_file, "r") as ding:
cites = BeautifulSoup(ding, "html.parser")

Expand Down Expand Up @@ -374,7 +370,6 @@ def transform_body(xml_tree, cited_data, publang):
logging.info("Found chapter author shortcuts: {}.".format(list_author_id))
if len(list_author_id) > 0:
author_string = format_authors(list_author_id, publang, xml_tree)
# print(author_string)
eoa_author = etree.Element("EOAauthor")
eoa_author.text = author_string
chapter_title.insert(0, eoa_author)
Expand Down Expand Up @@ -973,10 +968,6 @@ def main():
# create a dictionary entry containing the formatted references
formatted_references_dict[tmp_dict_key] = refs_for_bib_chapter

# refs for bib_chapter contains formatted reference entries
# render_reference(all_references, cited_dict)
# print(cited_dict)

tei_body = xml_tree.xpath("//t:body", namespaces=NS_MAP)[0]
body_transformed_tmp = transform_body(tei_body, cited_dict, publang=publication_language)
libeoaconvert.debug_xml_here(body_transformed_tmp, "body_transformed")
Expand Down

0 comments on commit 8c6d165

Please sign in to comment.