Changeset View
Changeset View
Standalone View
Standalone View
swh/indexer/metadata.py
Show First 20 Lines • Show All 70 Lines • ▼ Show 20 Lines | def index(self, id, data): | ||||
'translated_metadata': None | 'translated_metadata': None | ||||
} | } | ||||
try: | try: | ||||
mapping_name = self.tool['tool_configuration']['context'] | mapping_name = self.tool['tool_configuration']['context'] | ||||
result['translated_metadata'] = MAPPINGS[mapping_name] \ | result['translated_metadata'] = MAPPINGS[mapping_name] \ | ||||
.translate(data) | .translate(data) | ||||
except Exception: | except Exception: | ||||
self.log.exception( | self.log.exception( | ||||
"Problem during tool retrieval of metadata translation") | "Problem during metadata translation " | ||||
ardumontUnsubmitted Not Done Inline Actionsardumont: ```
%s", hashutil.hash_to_hex(id))
``` | |||||
Not Done Inline Actionsi meant: %s" % hashutil.hash_to_hex(id)) ardumont: i meant:
```
%s" % hashutil.hash_to_hex(id))
``` | |||||
Done Inline ActionsEither way works vlorentz: Either way works | |||||
"for content %s" % hashutil.hash_to_hex(id)) | |||||
return result | return result | ||||
def persist_index_computations(self, results, policy_update): | def persist_index_computations(self, results, policy_update): | ||||
"""Persist the results in storage. | """Persist the results in storage. | ||||
Args: | Args: | ||||
results ([dict]): list of content_metadata, dict with the | results ([dict]): list of content_metadata, dict with the | ||||
following keys: | following keys: | ||||
▲ Show 20 Lines • Show All 249 Lines • Show Last 20 Lines |