Removes link and DOI customization. Fixes #119.
This commit is contained in:
parent
0d38c73965
commit
a6d5df4059
@ -50,9 +50,7 @@ def customizations(record):
|
||||
record = bp.customization.editor(record)
|
||||
record = bp.customization.journal(record)
|
||||
record = bp.customization.keyword(record)
|
||||
record = bp.customization.link(record)
|
||||
record = bp.customization.page_double_hyphen(record)
|
||||
record = bp.customization.doi(record)
|
||||
|
||||
record = sanitize_citekey(record)
|
||||
|
||||
@ -95,8 +93,6 @@ class EnDecoder(object):
|
||||
entry[BP_ENTRYTYPE_KEY] = entry.pop(TYPE_KEY)
|
||||
for f in ignore_fields:
|
||||
entry.pop(f, None)
|
||||
if 'link' in entry:
|
||||
entry['link'] = ', '.join(link['url'] for link in entry['link'])
|
||||
if 'author' in entry:
|
||||
entry['author'] = ' and '.join(
|
||||
author for author in entry['author'])
|
||||
|
@ -112,6 +112,18 @@ class TestEnDecode(unittest.TestCase):
|
||||
self.assertEqual(lines[9].split('=')[0].strip(), u'note')
|
||||
self.assertEqual(lines[10].split('=')[0].strip(), u'abstract')
|
||||
|
||||
def test_endecode_link_as_url(self):
|
||||
decoder = endecoder.EnDecoder()
|
||||
if 'url = ' not in bibtex_raw0:
|
||||
raise NotImplementedError(
|
||||
'The fixture bibraw0 has been changed; test needs an update.')
|
||||
raw_with_link = bibtex_raw0.replace('url = ', 'link = ')
|
||||
entry = decoder.decode_bibdata(raw_with_link)
|
||||
lines = decoder.encode_bibdata(entry).splitlines()
|
||||
self.assertEqual(lines[8].split('=')[0].strip(), u'url')
|
||||
self.assertEqual(lines[8].split('=')[1].strip(),
|
||||
u'{http://ilpubs.stanford.edu:8090/422/},')
|
||||
|
||||
def test_endecode_bibtex_ignores_fields(self):
|
||||
decoder = endecoder.EnDecoder()
|
||||
entry = decoder.decode_bibdata(bibtex_raw0)
|
||||
|
Loading…
x
Reference in New Issue
Block a user