src package

Subpackages

Submodules

src.styleAttribs module

class StyleAttribute(ns: str, nsIsRelative: bool, tag: str, appliesTo: list[str], syntaxRegex: re.Pattern, defaultValue: str, computeValue: collections.abc.Callable[[specified, parent, params], str], fallbackComputeValue: collections.abc.Callable[[specified, parent, params], str])[source]

Bases: object

appliesTo: list[str]
computeValue: Callable[[specified, parent, params], str]
defaultValue: str
fallbackComputeValue: Callable[[specified, parent, params], str]
ns: str
nsIsRelative: bool
syntaxRegex: Pattern
tag: str
validateValue(value: str)[source]
attributeIsApplicableToElement(attr_key: str, el_tag: str) bool[source]
canonicaliseFontFamily(fontFamily: str) list[str][source]
computeStyles(tt_ns: str, validation_results: ValidationLogger, el_sss: dict[str, str], el_css: dict[str, str], parent_css: dict[str, str], params: dict[str, str], error_significance: int = 3) bool[source]
getAllStyleAttributeDict(tt_ns: str) dict[str, StyleAttribute][source]
getAllStyleAttributeKeys(tt_ns: str) list[str][source]
getMergedStyleSet(el: Element, id_to_styleattribs_map: dict[str, dict[str, str]]) dict[str, str][source]
getStyleAttributeDict(tt_ns: str, elements: list[str]) dict[str, StyleAttribute][source]
getStyleAttributeKeys(tt_ns: str, elements: list[str]) list[str][source]
validateStyleAttr(style_el: Element, context: dict, validation_results: ValidationLogger) bool[source]

src.timeExpression module

class TimeExpressionHandler(framerate: str | None = None, framerate_multiplier: str | None = None, tickrate: str | None = None)[source]

Bases: object

isFrameClockTime(time_expression: str) bool[source]
isNonFrameClockTime(time_expression: str) bool[source]
isOffsetTime(time_expression: str) bool[source]
seconds(time_value: str) float[source]
usesFrames(time_expression: str) bool[source]
usesTicks(time_expression: str) bool[source]

src.ttmlValidator module

get_epoch(args) float[source]
log_results_summary_bbc(valid: bool)[source]
log_results_summary_dapt(valid: bool)[source]
main()[source]
validate_ttml(args) int[source]

src.validationCollater module

Read a set of CSV validation files, count the number of Good, Info, Warn and Error for each ValidationCode, increment the number of each in an output CSV file by 1 for every count >0.

For example: 3 files: File 1 has: * 1x Good xml_document_validity, * 1x Good ebuttd_document_validity, * 0x Good bbc_document_validity * 1x Error bbc_document_validity

File 2 has: * 1x Good xml_document_validity, * 0x Good ebuttd_document_validity, * 0x Good bbc_document_validity * 1x Error bbc_document_validity

File 3 has: * 1x Good xml_document_validity, * 1x Good ebuttd_document_validity, * 1x Good bbc_document_validity * 0x Error bbc_document_validity

Result would be:

code,good_count,info_count,warn_count,error_count xml_document_validity,3,0,0,0 ebuttd_document_validity,2,0,0,0 bbc_document_validity,1,0,0,2

collate_validation(args) int[source]
main()[source]

src.xmlUtils module

get_namespace(tag: str) str[source]
get_unqualified_name(tag: str) str[source]
make_qname(namespace: str, name: str) str[source]

Module contents