Rename type dict entry to entrytype according to change in bibtexparser 0.6.1
This commit is contained in:
parent
94c2771e4e
commit
a25f21f451
2
bmc.py
2
bmc.py
@ -220,7 +220,7 @@ def addFile(src, filetype, manual, autoconfirm, tag, rename=True):
|
||||
|
||||
# Remove first page of IOP papers
|
||||
try:
|
||||
if 'IOP' in bibtex['publisher'] and bibtex['type'] == 'article':
|
||||
if 'IOP' in bibtex['publisher'] and bibtex['entrytype'] == 'article':
|
||||
tearpages.tearpage(new_name)
|
||||
except (KeyError, shutil.Error, IOError):
|
||||
pass
|
||||
|
@ -29,7 +29,7 @@ def getNewName(src, bibtex, tag='', override_format=None):
|
||||
"""
|
||||
authors = re.split(' and ', bibtex['author'])
|
||||
|
||||
if bibtex['type'] == 'article':
|
||||
if bibtex['entrytype'] == 'article':
|
||||
if override_format is None:
|
||||
new_name = config.get("format_articles")
|
||||
else:
|
||||
@ -38,7 +38,7 @@ def getNewName(src, bibtex, tag='', override_format=None):
|
||||
new_name = new_name.replace("%j", bibtex['journal'])
|
||||
except KeyError:
|
||||
pass
|
||||
elif bibtex['type'] == 'book':
|
||||
elif bibtex['entrytype'] == 'book':
|
||||
if override_format is None:
|
||||
new_name = config.get("format_books")
|
||||
else:
|
||||
|
@ -46,9 +46,9 @@ def slugify(value):
|
||||
|
||||
def parsed2Bibtex(parsed):
|
||||
"""Convert a single bibtex entry dict to bibtex string"""
|
||||
bibtex = '@'+parsed['type']+'{'+parsed['id']+",\n"
|
||||
bibtex = '@'+parsed['entrytype']+'{'+parsed['id']+",\n"
|
||||
|
||||
for field in [i for i in sorted(parsed) if i not in ['type', 'id']]:
|
||||
for field in [i for i in sorted(parsed) if i not in ['entrytype', 'id']]:
|
||||
bibtex += "\t"+field+"={"+parsed[field]+"},\n"
|
||||
bibtex += "}\n\n"
|
||||
return bibtex
|
||||
|
Loading…
Reference in New Issue
Block a user