Changeset View
Changeset View
Standalone View
Standalone View
swh/objstorage/objstorage.py
Show First 20 Lines • Show All 53 Lines • ▼ Show 20 Lines | def unused_data(self): | ||||
return b'' | return b'' | ||||
decompressors = { | decompressors = { | ||||
'bz2': bz2.BZ2Decompressor, | 'bz2': bz2.BZ2Decompressor, | ||||
'lzma': lzma.LZMADecompressor, | 'lzma': lzma.LZMADecompressor, | ||||
'gzip': lambda: zlib.decompressobj(wbits=31), | 'gzip': lambda: zlib.decompressobj(wbits=31), | ||||
'zlib': zlib.decompressobj, | 'zlib': zlib.decompressobj, | ||||
None: NullDecompressor, | 'none': NullDecompressor, | ||||
} | } | ||||
compressors = { | compressors = { | ||||
'bz2': bz2.BZ2Compressor, | 'bz2': bz2.BZ2Compressor, | ||||
'lzma': lzma.LZMACompressor, | 'lzma': lzma.LZMACompressor, | ||||
'gzip': lambda: zlib.compressobj(wbits=31), | 'gzip': lambda: zlib.compressobj(wbits=31), | ||||
'zlib': zlib.compressobj, | 'zlib': zlib.compressobj, | ||||
None: NullCompressor, | 'none': NullCompressor, | ||||
} | } | ||||
class ObjStorage(metaclass=abc.ABCMeta): | class ObjStorage(metaclass=abc.ABCMeta): | ||||
""" High-level API to manipulate the Software Heritage object storage. | """ High-level API to manipulate the Software Heritage object storage. | ||||
Conceptually, the object storage offers the following methods: | Conceptually, the object storage offers the following methods: | ||||
- check_config() check if the object storage is properly configured | - check_config() check if the object storage is properly configured | ||||
▲ Show 20 Lines • Show All 263 Lines • Show Last 20 Lines |