From a25f21f4514a25f1ea0cbf9418b495332e0c8795 Mon Sep 17 00:00:00 2001 From: Phyks Date: Fri, 21 Aug 2015 23:45:19 +0200 Subject: [PATCH] Rename type dict entry to entrytype according to change in bibtexparser 0.6.1 --- bmc.py | 2 +- libbmc/backend.py | 4 ++-- libbmc/tools.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bmc.py b/bmc.py index 07d016f..5ed94d0 100755 --- a/bmc.py +++ b/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 diff --git a/libbmc/backend.py b/libbmc/backend.py index b70cca7..61c32fb 100644 --- a/libbmc/backend.py +++ b/libbmc/backend.py @@ -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: diff --git a/libbmc/tools.py b/libbmc/tools.py index c566c77..99533ee 100644 --- a/libbmc/tools.py +++ b/libbmc/tools.py @@ -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