Scheduled service maintenance on November 22


On Friday, November 22, 2024, between 06:00 CET and 18:00 CET, GIN services will undergo planned maintenance. Extended service interruptions should be expected. We will try to keep downtimes to a minimum, but recommend that users avoid critical tasks, large data uploads, or DOI requests during this time.

We apologize for any inconvenience.

text.py 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. """
  2. Instances of the Text class just contain
  3. text. Their main use is as dummy-element
  4. during model development.
  5. """
  6. from typing import (
  7. Iterable,
  8. Optional
  9. )
  10. from dataladmetadatamodel.mappableobject import MappableObject
  11. from dataladmetadatamodel.mapper.reference import Reference
  12. class Text(MappableObject):
  13. def __init__(self,
  14. content: Optional[str] = None,
  15. reference: Optional[Reference] = None):
  16. assert isinstance(content, (type(None), str))
  17. assert isinstance(reference, (type(None), Reference))
  18. super().__init__(reference)
  19. self.content = content
  20. @staticmethod
  21. def get_empty_instance(reference: Optional[Reference] = None):
  22. return Text(None, reference)
  23. def get_modifiable_sub_objects_impl(self) -> Iterable[MappableObject]:
  24. return []
  25. def purge_impl(self):
  26. self.content = None
  27. def deepcopy_impl(self,
  28. new_mapper_family: Optional[str] = None,
  29. new_destination: Optional[str] = None,
  30. **kwargs) -> "Text":
  31. return Text(content=self.content, reference=self.reference)