Commit d12fef74 authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Update Record with a better coding for oai and oai_url

parent 9bba88a5
......@@ -234,15 +234,8 @@ class Record(dict):
an empty string when it is not defined.
"""
oai_1 = self.primary_oai()
if not oai_1:
return ""
oai_2 = self.secondary_oai()
if not oai_2:
return oai_1
return "%s, %s" % (oai_1, oai_2)
lst = [self.primary_oai(), self.secondary_oai()]
return ", ".join(lst).strip(", ")
def oai_url(self):
"""The Open Archive Initiative identifier URL(s).
......@@ -255,15 +248,8 @@ class Record(dict):
not well formed.
"""
oai_url_1 = self.primary_oai_url()
if not oai_url_1:
return ""
oai_url_2 = self.secondary_oai_url()
if not oai_url_2:
return oai_url_1
return "%s, %s" % (oai_url_1, oai_url_2)
lst = [self.primary_oai_url(), self.secondary_oai_url()]
return ", ".join(lst).strip(", ")
def primary_oai(self):
"""The primary Open Archive Initiative identifier.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment