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): ...@@ -234,15 +234,8 @@ class Record(dict):
an empty string when it is not defined. an empty string when it is not defined.
""" """
oai_1 = self.primary_oai() lst = [self.primary_oai(), self.secondary_oai()]
if not oai_1: return ", ".join(lst).strip(", ")
return ""
oai_2 = self.secondary_oai()
if not oai_2:
return oai_1
return "%s, %s" % (oai_1, oai_2)
def oai_url(self): def oai_url(self):
"""The Open Archive Initiative identifier URL(s). """The Open Archive Initiative identifier URL(s).
...@@ -255,15 +248,8 @@ class Record(dict): ...@@ -255,15 +248,8 @@ class Record(dict):
not well formed. not well formed.
""" """
oai_url_1 = self.primary_oai_url() lst = [self.primary_oai_url(), self.secondary_oai_url()]
if not oai_url_1: return ", ".join(lst).strip(", ")
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)
def primary_oai(self): def primary_oai(self):
"""The primary Open Archive Initiative identifier. """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