capella2polarion.data_model package¶
A module for custom data models of cappela2polarion.
Submodules¶
capella2polarion.data_model.document_data module¶
Module providing data classes for documents.
- class capella2polarion.data_model.document_data.DocumentData(document: Document, headings: list[WorkItem], text_work_item_provider: TextWorkItemProvider)¶
Bases:
object
A class to store data related to a rendered document.
- document: Document¶
- text_work_item_provider: TextWorkItemProvider¶
capella2polarion.data_model.work_item_attachments module¶
Module providing the CapellaWorkItemAttachment classes.
- class capella2polarion.data_model.work_item_attachments.Capella2PolarionAttachment(work_item_id: str, id: str, title: str | None = None, content_bytes: bytes | None = None, mime_type: str | None = None, file_name: str | None = None, _checksum: str | None = None)¶
Bases:
WorkItemAttachment
Stub Base-Class for Capella2Polarion attachments.
- class capella2polarion.data_model.work_item_attachments.CapellaContextDiagramAttachment(diagram: ContextDiagram, file_name: str, render_params: dict[str, Any] | None, title: str)¶
Bases:
CapellaDiagramAttachment
A dedicated attachment type for Capella context diagrams.
Implements a checksum property using the elk input instead of content. This will speed up the checksum calculation a lot.
- class capella2polarion.data_model.work_item_attachments.CapellaDiagramAttachment(diagram: AbstractDiagram, file_name: str, render_params: dict[str, Any] | None, title: str)¶
Bases:
Capella2PolarionAttachment
A class for lazy loading content_bytes for diagram attachments.
- class capella2polarion.data_model.work_item_attachments.PngConvertedSvgAttachment(attachment: WorkItemAttachment)¶
Bases:
Capella2PolarionAttachment
A special attachment type for PNGs which shall be created from SVGs.
An SVG attachment must be provided to create this attachment. The actual conversion of SVG to PNG takes place when content bytes are requested. For that reason creating this attachment does not trigger diagram rendering as long as context_bytes aren’t requested.
capella2polarion.data_model.work_items module¶
Module providing the CapellaWorkItem class.
- class capella2polarion.data_model.work_items.CapellaWorkItem(id: str | None = None, *, title: str | None = None, description_type: str | None = None, description: TextContent | str | None = None, type: str | None = None, status: str | None = None, additional_attributes: dict[str, Any] | None = None, linked_work_items: list[WorkItemLink] | None = None, attachments: list[WorkItemAttachment] | None = None, linked_work_items_truncated: bool = False, attachments_truncated: bool = False, home_document: DocumentReference | None = None, **kwargs)¶
Bases:
WorkItem
A WorkItem class with additional Capella related attributes.
- calculate_checksum() str ¶
Calculate and return a checksum for this WorkItem.
In addition, the checksum will be written to self._checksum. Filenames must be unique and same filenames are only valid for png&svg pairs.
- clear_attributes()¶
Clear all additional attributes except the checksum.