interface.py 920 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. # Copyright (c) 2010-2024 openpyxl
  2. from abc import abstractproperty
  3. from openpyxl.compat.abc import ABC
  4. class ISerialisableFile(ABC):
  5. """
  6. Interface for Serialisable classes that represent files in the archive
  7. """
  8. @abstractproperty
  9. def id(self):
  10. """
  11. Object id making it unique
  12. """
  13. pass
  14. @abstractproperty
  15. def _path(self):
  16. """
  17. File path in the archive
  18. """
  19. pass
  20. @abstractproperty
  21. def _namespace(self):
  22. """
  23. Qualified namespace when serialised
  24. """
  25. pass
  26. @abstractproperty
  27. def _type(self):
  28. """
  29. The content type for the manifest
  30. """
  31. @abstractproperty
  32. def _rel_type(self):
  33. """
  34. The content type for relationships
  35. """
  36. @abstractproperty
  37. def _rel_id(self):
  38. """
  39. Links object with parent
  40. """