Changeset View
Changeset View
Standalone View
Standalone View
swh/objstorage/objstorage.py
Show First 20 Lines • Show All 56 Lines • ▼ Show 20 Lines | class ObjStorage(metaclass=abc.ABCMeta): | ||||
- get_stream() same as get() but returns a chunked iterator | - get_stream() same as get() but returns a chunked iterator | ||||
Each implementation of this interface can have a different behavior and | Each implementation of this interface can have a different behavior and | ||||
its own way to store the contents. | its own way to store the contents. | ||||
""" | """ | ||||
def __init__(self, *, allow_delete=False, **kwargs): | def __init__(self, *, allow_delete=False, **kwargs): | ||||
# A more complete permission system could be used in place of that if | # A more complete permission system could be used in place of that if | ||||
# it becomes needed | # it becomes needed | ||||
super().__init__(**kwargs) | |||||
self.allow_delete = allow_delete | self.allow_delete = allow_delete | ||||
@abc.abstractmethod | @abc.abstractmethod | ||||
def check_config(self, *, check_write): | def check_config(self, *, check_write): | ||||
"""Check whether the object storage is properly configured. | """Check whether the object storage is properly configured. | ||||
Args: | Args: | ||||
check_write (bool): if True, check if writes to the object storage | check_write (bool): if True, check if writes to the object storage | ||||
▲ Show 20 Lines • Show All 215 Lines • Show Last 20 Lines |