opatio.base.header module¶
- class opatio.base.header.Header(version: int, numCards: int, headerSize: int, catalogOffset: int, creationDate: str, sourceInfo: str, comment: str, numIndex: int, hashPrecision: int, reserved: bytes = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', magic: str = 'OPAT')[source]¶
Bases:
OPATEntity
A class to represent the header information of an OPAT file.
- reserved: bytes = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'¶
- set_comment(comment: str)[source]¶
Sets the comment of the header.
- Parameters:
comment (str) – The comment to set.
- Raises:
ValueError – If the comment string exceeds 128 characters.
Examples
>>> header = Header(...) >>> header.set_comment("This is a comment.")
- set_source(source: str)[source]¶
Sets the source information of the header.
- Parameters:
source (str) – The source information to set.
- Raises:
ValueError – If the source string exceeds 64 characters.
Examples
>>> header = Header(...) >>> header.set_source("Source information")