Skip to content

Commit e39ca97

Browse files
committed
changing context type for v2
1 parent f668d7e commit e39ca97

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

pyclowder/extractors.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -260,17 +260,7 @@ def get_metadata(self, content, resource_type, resource_id, server=None, context
260260
md = dict()
261261
md["file_version"] = 1
262262
if contexts is not None:
263-
md["context"] = contexts
264-
else:
265-
md["context"] = {}
266-
if type(self.extractor_info['contexts'] == list):
267-
if len(self.extractor_info['contexts']) > 0:
268-
if len(self.extractor_info) == 1:
269-
md["context"] = self.extractor_info["contexts"]
270-
else:
271-
# TODO is this necessary? should contexts should always be a list with one dictionary?
272-
current_contexts = self.extractor_info["contexts"]
273-
reduce(lambda a, b: dict(a, **b), current_contexts)
263+
md["context"] = [context_url] + contexts
274264
md["context_url"] = context_url
275265
md["content"] = content
276266
md["contents"] = content

0 commit comments

Comments
 (0)