__all__ = [
'UnsupportedAttachment',
]
from .. import constants
from .attachment_base import AttachmentBase
from ..enums import AttachmentType, SaveType
[docs]class UnsupportedAttachment(AttachmentBase):
"""
An attachment whose type is not currently supported.
"""
[docs] def getFilename(self, **_) -> str:
raise NotImplementedError('Unsupported attachments cannot be saved.')
[docs] def save(self, **kwargs) -> constants.SAVE_TYPE:
"""
Raises a NotImplementedError unless :param skipNotImplemented: is set to
``True``.
If it is, returns a value that indicates no data was saved.
"""
if kwargs.get('skipNotImplemented', False):
return (SaveType.NONE, None)
raise NotImplementedError('Unsupported attachments cannot be saved.')
@property
def data(self) -> None:
"""
Broken attachments have no data.
"""
return None
@property
def type(self) -> AttachmentType:
return AttachmentType.UNSUPPORTED