Partial fix for #188
This commit is contained in:
parent
1c892bd64e
commit
3a4acb9fa9
@ -113,7 +113,7 @@ class EnDecoder(object):
|
||||
author for author in entry['author'])
|
||||
if 'editor' in entry:
|
||||
entry['editor'] = ' and '.join(
|
||||
editor['name'] for editor in entry['editor'])
|
||||
editor for editor in entry['editor'])
|
||||
if 'keyword' in entry:
|
||||
entry['keyword'] = ', '.join(
|
||||
keyword for keyword in entry['keyword'])
|
||||
@ -137,6 +137,11 @@ class EnDecoder(object):
|
||||
# Convert bibtexparser entrytype key to internal 'type'
|
||||
t = entries[e].pop(BP_ENTRYTYPE_KEY)
|
||||
entries[e][TYPE_KEY] = t
|
||||
# Temporary fix to #188 (to be fully fixed when the upstream
|
||||
# issue: sciunto-org/python-bibtexparser/#229 is fixed too)
|
||||
if 'editor' in entries[e]:
|
||||
entries[e]['editor'] = [
|
||||
editor['name'] for editor in entries[e]['editor']]
|
||||
if len(entries) > 0:
|
||||
return entries
|
||||
else:
|
||||
|
16
tests/data/many_fields.bib
Normal file
16
tests/data/many_fields.bib
Normal file
@ -0,0 +1,16 @@
|
||||
@ARTICLE{Cesar2013,
|
||||
authors = {Jean César},
|
||||
title = {An amazing title},
|
||||
year = {2013},
|
||||
month = "jan",
|
||||
volume = {12},
|
||||
pages = {12-23},
|
||||
journal = {Nice Journal},
|
||||
abstract = {This is an abstract. This line should be long enough to test
|
||||
multilines... and with a french érudit word},
|
||||
comments = {A comment},
|
||||
editors = {Edith Or and Anne Other},
|
||||
keywords = {keyword1, keyword2},
|
||||
links = {http://my.link/to-content},
|
||||
subjects = "Some topic of interest",
|
||||
}
|
@ -861,7 +861,7 @@ class TestUsecase(DataCommandTestCase):
|
||||
]
|
||||
|
||||
outs = self.execute_cmds(cmds)
|
||||
self.assertEqual(8, len(outs[-1].split('\n')))
|
||||
self.assertEqual(9, len(outs[-1].split('\n')))
|
||||
|
||||
def test_import_one(self):
|
||||
cmds = ['pubs init',
|
||||
|
Loading…
x
Reference in New Issue
Block a user