Changeset View
Changeset View
Standalone View
Standalone View
swh/indexer/mimetype.py
Show First 20 Lines • Show All 42 Lines • ▼ Show 20 Lines | ADDITIONAL_CONFIG = { | ||||
"debian-package": "python3-magic" | "debian-package": "python3-magic" | ||||
}, | }, | ||||
}), | }), | ||||
'write_batch_size': ('int', 1000), | 'write_batch_size': ('int', 1000), | ||||
} | } | ||||
CONFIG_BASE_FILENAME = 'indexer/mimetype' | CONFIG_BASE_FILENAME = 'indexer/mimetype' | ||||
def prepare(self): | |||||
super().prepare() | |||||
self.tool = self.tools[0] | |||||
def index(self, id, data): | def index(self, id, data): | ||||
"""Index sha1s' content and store result. | """Index sha1s' content and store result. | ||||
Args: | Args: | ||||
id (bytes): content's identifier | id (bytes): content's identifier | ||||
data (bytes): raw content in bytes | data (bytes): raw content in bytes | ||||
Returns: | Returns: | ||||
▲ Show 20 Lines • Show All 88 Lines • Show Last 20 Lines |