Skip to content

Commit c59b878

Browse files
committed
Plugins tested
1 parent c6c0a6b commit c59b878

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

plugins/oai-pmh/plugin.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ def __init__(
3737
self.config = config
3838
self.name = name
3939
self.lang = lang
40-
self.oai_base = api_endpoint
41-
super().__init__(item_id, self.oai_base, self.lang, self.config, self.name)
40+
self.api_endpoint = api_endpoint
41+
super().__init__(item_id, self.api_endpoint, self.lang, self.config, self.name)
4242
logger.debug("Using FAIR-EVA's plugin: %s" % self.name)
4343
global _
4444
_ = super().translation()
@@ -188,9 +188,13 @@ def oai_request(self, oai_base, action):
188188
return xmlTree
189189

190190
def get_metadata(self):
191-
logger.debug("OAI_BASE IN evaluator: %s" % self.oai_base)
192-
if self.oai_base is not None and self.oai_base != "" and self.metadata is None:
193-
metadataFormats = self.oai_metadataFormats(self.oai_base)
191+
logger.debug("OAI_BASE IN evaluator: %s" % self.api_endpoint)
192+
if (
193+
self.api_endpoint is not None
194+
and self.api_endpoint != ""
195+
and self.metadata is None
196+
):
197+
metadataFormats = self.oai_metadataFormats(self.api_endpoint)
194198
dc_prefix = ""
195199
for e in metadataFormats:
196200
if metadataFormats[e] == "http://www.openarchives.org/OAI/2.0/oai_dc/":
@@ -205,7 +209,9 @@ def get_metadata(self):
205209
logger.debug("Trying to get metadata")
206210
try:
207211
item_metadata = self.oai_get_metadata(
208-
self.oai_check_record_url(self.oai_base, dc_prefix, self.item_id)
212+
self.oai_check_record_url(
213+
self.api_endpoint, dc_prefix, self.item_id
214+
)
209215
).find(".//{http://www.openarchives.org/OAI/2.0/}metadata")
210216
except Exception as e:
211217
logger.error("Problem getting metadata: %s" % e)

0 commit comments

Comments
 (0)