| 185 | |
| 186 | |
| 187 | class String(ScalarVariable): |
| 188 | def __init__(self, name: str, start: Optional[Any] = None, **kwargs): |
| 189 | super().__init__(name, **kwargs) |
| 190 | self.__attrs = {"start": start} |
| 191 | |
| 192 | @property |
| 193 | def start(self) -> Optional[Any]: |
| 194 | return self.__attrs["start"] |
| 195 | |
| 196 | @start.setter |
| 197 | def start(self, value: float): |
| 198 | self.__attrs["start"] = value |
| 199 | |
| 200 | def to_xml(self) -> Element: |
| 201 | attrib = dict() |
| 202 | for key, value in self.__attrs.items(): |
| 203 | if value is not None: |
| 204 | attrib[key] = str(value) |
| 205 | parent = super().to_xml() |
| 206 | SubElement(parent, "String", attrib) |
| 207 | |
| 208 | return parent |
no outgoing calls