Changeset View
Changeset View
Standalone View
Standalone View
swh/indexer/metadata.py
Show First 20 Lines • Show All 112 Lines • ▼ Show 20 Lines | class RevisionMetadataIndexer(RevisionIndexer): | ||||
- store the results for revision | - store the results for revision | ||||
""" | """ | ||||
CONFIG_BASE_FILENAME = 'indexer/metadata' | CONFIG_BASE_FILENAME = 'indexer/metadata' | ||||
ADDITIONAL_CONFIG = { | ADDITIONAL_CONFIG = { | ||||
'tools': ('dict', { | 'tools': ('dict', { | ||||
'name': 'swh-metadata-detector', | 'name': 'swh-metadata-detector', | ||||
'version': '0.0.1', | 'version': '0.0.2', | ||||
'configuration': { | 'configuration': { | ||||
'type': 'local', | 'type': 'local', | ||||
'context': ['npm', 'codemeta'] | 'context': ['npm', 'codemeta'] | ||||
}, | }, | ||||
}), | }), | ||||
} | } | ||||
ContentMetadataIndexer = ContentMetadataIndexer | ContentMetadataIndexer = ContentMetadataIndexer | ||||
▲ Show 20 Lines • Show All 79 Lines • ▼ Show 20 Lines | def translate_revision_metadata(self, detected_files): | ||||
Returns: | Returns: | ||||
dict: dict with translated metadata according to the CodeMeta | dict: dict with translated metadata according to the CodeMeta | ||||
vocabulary | vocabulary | ||||
""" | """ | ||||
translated_metadata = [] | translated_metadata = [] | ||||
tool = { | tool = { | ||||
'name': 'swh-metadata-translator', | 'name': 'swh-metadata-translator', | ||||
'version': '0.0.1', | 'version': '0.0.2', | ||||
'configuration': { | 'configuration': { | ||||
'type': 'local', | 'type': 'local', | ||||
'context': None | 'context': None | ||||
}, | }, | ||||
} | } | ||||
# TODO: iterate on each context, on each file | # TODO: iterate on each context, on each file | ||||
# -> get raw_contents | # -> get raw_contents | ||||
# -> translate each content | # -> translate each content | ||||
▲ Show 20 Lines • Show All 111 Lines • Show Last 20 Lines |