Changeset View
Changeset View
Standalone View
Standalone View
swh/indexer/storage/in_memory.py
Show First 20 Lines • Show All 303 Lines • ▼ Show 20 Lines | def content_language_add(self, languages, conflict_update=False): | ||||
- **id** (bytes): sha1 | - **id** (bytes): sha1 | ||||
- **lang** (bytes): language detected | - **lang** (bytes): language detected | ||||
conflict_update (bool): Flag to determine if we want to | conflict_update (bool): Flag to determine if we want to | ||||
overwrite (true) or skip duplicates (false, the | overwrite (true) or skip duplicates (false, the | ||||
default) | default) | ||||
""" | """ | ||||
if not all(isinstance(x['id'], bytes) for x in languages): | |||||
raise TypeError('identifiers must be bytes.') | |||||
self._languages.add(languages, conflict_update) | self._languages.add(languages, conflict_update) | ||||
def content_ctags_missing(self, ctags): | def content_ctags_missing(self, ctags): | ||||
"""List ctags missing from storage. | """List ctags missing from storage. | ||||
Args: | Args: | ||||
ctags (iterable): dicts with keys: | ctags (iterable): dicts with keys: | ||||
▲ Show 20 Lines • Show All 391 Lines • Show Last 20 Lines |