Create a new BcfXml object. Args: project_name: The name of the project. xml_handler: XML parser and serializer. Returns: A new BcfXml object.
(
cls,
project_name: Optional[str] = None,
xml_handler: Optional[AbstractXmlParserSerializer] = None,
)
| 171 | |
| 172 | @classmethod |
| 173 | def create_new( |
| 174 | cls, |
| 175 | project_name: Optional[str] = None, |
| 176 | xml_handler: Optional[AbstractXmlParserSerializer] = None, |
| 177 | ) -> BcfXml: |
| 178 | """ |
| 179 | Create a new BcfXml object. |
| 180 | |
| 181 | Args: |
| 182 | project_name: The name of the project. |
| 183 | xml_handler: XML parser and serializer. |
| 184 | |
| 185 | Returns: |
| 186 | A new BcfXml object. |
| 187 | """ |
| 188 | instance = cls(xml_handler=xml_handler or XmlParserSerializer()) |
| 189 | instance.project_info = mdl.ProjectExtension( |
| 190 | project=mdl.Project(name=project_name, project_id=str(uuid.uuid4())), extension_schema="" |
| 191 | ) |
| 192 | return instance |
| 193 | |
| 194 | def save(self, filename: Optional[Path] = None, keep_open: bool = False) -> None: |
| 195 | """Save the BCF file to the given filename.""" |