Changeset View
Changeset View
Standalone View
Standalone View
swh/indexer/storage/in_memory.py
Show First 20 Lines • Show All 749 Lines • ▼ Show 20 Lines | def indexer_configuration_get(self, tool): | ||||
Returns: | Returns: | ||||
The same dictionary with an `id` key, None otherwise. | The same dictionary with an `id` key, None otherwise. | ||||
""" | """ | ||||
return self._tools.get(self._tool_key(tool)) | return self._tools.get(self._tool_key(tool)) | ||||
def _tool_key(self, tool): | def _tool_key(self, tool): | ||||
return (tool['tool_name'], tool['tool_version'], | return hash((tool['tool_name'], tool['tool_version'], | ||||
json.dumps(tool['tool_configuration'], sort_keys=True)) | json.dumps(tool['tool_configuration'], sort_keys=True))) |