bcf.v2.bcfxml#

BCF XML V2 handler.

Module Contents#

bcf.v2.bcfxml.T#
class bcf.v2.bcfxml.BcfXml(filename: Optional[pathlib.Path] = None, xml_handler: Optional[bcf.xml_parser.AbstractXmlParserSerializer] = None)#

BCF XML handler.

__del__(self) None#
__enter__(self) BcfXml#
__eq__(self, other: object) bool | NoReturn#

Return self==value.

__exit__(self, *args: Any) None#
_load_topics(self, zip_file: zipfile.ZipFile, xml_handler: bcf.xml_parser.AbstractXmlParserSerializer) dict[str, bcf.v2.topic.TopicHandler]#
_load_zip_file(self) Optional[zipfile.ZipFile]#
_save_project(self, destination_zip: bcf.inmemory_zipfile.ZipFileInterface) None#
_save_topics(self, destination_zip: bcf.inmemory_zipfile.ZipFileInterface) None#
_save_version(self, destination_zip: bcf.inmemory_zipfile.ZipFileInterface) None#
_save_xml(self, destination_zip: bcf.inmemory_zipfile.ZipFileInterface, inner_file: str, xml_obj: Any) None#
_smart_save_xml(self, destination_zip: bcf.inmemory_zipfile.ZipFileInterface, item: Any, target: str) None#
add_comment(self, _topic: bcf.v2.model.Topic, _comment: Optional[bcf.v2.model.Comment] = None) None#

Deprecated method.

add_topic(self, title: str, description: str, author: str, topic_type: str = '', topic_status: str = '') bcf.v2.topic.TopicHandler#

Add a new topic to the BCF.

Args:

title: The title of the topic. description: The description of the topic. author: The author of the topic. topic_type: The type of the topic. topic_status: The status of the topic.

Returns:

The newly created topic wrapped inside a TopicHandler object.

close(self) None#
classmethod create_new(cls, project_name: Optional[str] = None, xml_handler: Optional[bcf.xml_parser.AbstractXmlParserSerializer] = None) BcfXml#

Create a new BcfXml object.

Args:

project_name: The name of the project. xml_handler: XML parser and serializer.

Returns:

A new BcfXml object.

edit_comment(self) None#

Deprecated method.

edit_project(self) None#

Deprecated method.

edit_topic(self) None#

Deprecated method.

edit_version(self) None#

Deprecated method.

property extension_schema(self) Optional[bytes]#
get_header(self, guid: str) Optional[bcf.v2.model.Header]#

Return the header of a Topic by its GUID.

get_project(self, _filepath: Optional[str] = None) Optional[bcf.v2.model.Project]#

Deprecated method.

get_topic(self, guid: str) bcf.v2.topic.TopicHandler#

Return a topic by its GUID.

get_topics(self) dict[str, bcf.v2.topic.TopicHandler]#

Deprecated method.

get_version(self) Optional[str]#
classmethod load(cls, filename: pathlib.Path, xml_handler: Optional[bcf.xml_parser.AbstractXmlParserSerializer] = None) Optional[BcfXml]#

Create a BcfXml object from a file.

Args:

filename: Path to the file. xml_handler: XML parser and serializer.

Returns:

A BcfXml object with the file contents.

Raises:

ValueError: If the file name is null or empty

new_project(self) BcfXml#

Deprecated method.

property project(self) Optional[bcf.v2.model.Project]#

BCF project.

property project_info(self) Optional[bcf.v2.model.ProjectExtension]#

BCF project information.

save(self, filename: Optional[pathlib.Path] = None, keep_open: bool = False) None#

Save the BCF file to the given filename.

save_project(self, filepath: pathlib.Path) None#

Deprecated method.

property topics(self) dict[str, bcf.v2.topic.TopicHandler]#

BCF topics.

property version(self) bcf.v2.model.Version#

Bcf Version.