Skip to content

Commit

Permalink
Merge pull request #56 from rettinghaus/master
Browse files Browse the repository at this point in the history
update deprecated function
  • Loading branch information
rettinghaus committed Sep 22, 2019
2 parents 7aa3e2f + 96d56fa commit 5ad61a9
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .zenodo.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"title": "CSV2CMI",
"description": "converts a table of letters into CMI format",
"publication_date": "2019-03-29",
"publication_date": "2019-09-22",
"creators": [{
"name": "Rettinghaus, Klaus",
"orcid": "0000-0003-1898-2543"
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2015-2018 by Klaus Rettinghaus
Copyright (c) 2015-2019 by Klaus Rettinghaus

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 2 additions & 2 deletions codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
"identifier": "CSV2CMI",
"name": "CSV2CMI",
"description": "converts a table of letters into CMI format",
"softwareVersion": "2.0.1",
"softwareVersion": "2.0.2",
"license": "OSI Approved :: MIT License",
"programmingLanguage": "Python :: 3",
"maintainer": "https://orcid.org/0000-0003-1898-2543",
"datePublished": "2019-03-29",
"datePublished": "2019-09-22",
"codeRepository": "https://github.com/saw-leipzig/csv2cmi",
"author": [{
"@id": "https://orcid.org/0000-0003-1898-2543",
Expand Down
7 changes: 4 additions & 3 deletions csv2cmi.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from xml.etree.ElementTree import Element, SubElement, Comment, ElementTree

__license__ = "MIT"
__version__ = '2.0.1'
__version__ = '2.0.2'

# define log output
logging.basicConfig(format='%(levelname)s: %(message)s')
Expand Down Expand Up @@ -134,15 +134,15 @@ def createFileDesc(config):
editors = config.get('Project', 'editor').splitlines()
for entity in editors:
SubElement(titleStmt, 'editor').text = entity
if len(titleStmt.getchildren()) == 1:
if len(list(titleStmt)) == 1:
logging.warning('Editor missing')
SubElement(titleStmt, 'editor')
# publication statement
publicationStmt = SubElement(fileDesc, 'publicationStmt')
publishers = config.get('Project', 'publisher').splitlines()
for entity in publishers:
SubElement(publicationStmt, 'publisher').text = entity
if not(publicationStmt.getchildren()):
if not(list(publicationStmt)):
for editor in titleStmt.findall('editor'):
SubElement(publicationStmt, 'publisher').text = editor.text
idno = SubElement(publicationStmt, 'idno')
Expand Down Expand Up @@ -591,5 +591,6 @@ def processPlace(letter, correspondent):

try:
tree.write(outFile, encoding="utf-8", xml_declaration=True, method="xml")
print('CMI file written to', outFile)
except PermissionError:
logging.error('Could not save the file due to insufficient permission')

0 comments on commit 5ad61a9

Please sign in to comment.