# Path: ebu_tt_live/errors.py
# class SemanticValidationError(Exception):
#     pass
# 
# Path: ebu_tt_live/strings.py
# ERR_SEMANTIC_STYLE_MISSING = gettext('Style: {style} is not found.')
# 
# ERR_SEMANTIC_VALIDATION_EXPECTED = gettext('Please run semantic validation before calling this function')
# 
# ERR_SEMANTIC_REGION_MISSING = gettext('Region: {region} is not found.')


from ebu_tt_live.errors import SemanticValidationError
from ebu_tt_live.strings import ERR_SEMANTIC_STYLE_MISSING, ERR_SEMANTIC_VALIDATION_EXPECTED, \
    ERR_SEMANTIC_REGION_MISSING
    def _semantic_pop_styles(self, dataset):
        dataset['styles_stack'].pop()

    @property
    def specified_style(self):
        """
        This is the resolution of the Style attributes that are directly linked to this element even via implicit
        inheritance of the style attributes
        :return:
        """
        return self._specified_style

    @property
    def computed_style(self):
        """
        In particular because of fontSize cascading semantics we need to be able to calculate the effective fontSize
        in any styled element container. Without it conversion from absolute values to relative would not be possible.
        This is a requirement for the EBU-TT-D conversion where only percentages are allowed in sizing attributes.
        To support converting the pixel/celll values that don't cascade to percentages that do the simplest
        approach is to compute the style in whatever crazy constellation of units it may be provided in and generate
        percentage based styles for p and span elements taking into account their relative cascading nature. Yes if
        this confused you please refer to the documentation of EBU-TT-D, EBU-TT-Live, TTML and whatever else TTML might
        refer to in terms of these style attributes.
        :return:
        """
        return self._computed_style

    @property
    def validated_styles(self):
        if self._validated_styles is None:

# Path: ebu_tt_live/errors.py
# class SemanticValidationError(Exception):
#     pass
# 
# Path: ebu_tt_live/strings.py
# ERR_SEMANTIC_STYLE_MISSING = gettext('Style: {style} is not found.')
# 
# ERR_SEMANTIC_VALIDATION_EXPECTED = gettext('Please run semantic validation before calling this function')
# 
# ERR_SEMANTIC_REGION_MISSING = gettext('Region: {region} is not found.')


# Path: ebu_tt_live/bindings/validation/presentation.py
from ebu_tt_live.errors import SemanticValidationError
from ebu_tt_live.strings import ERR_SEMANTIC_STYLE_MISSING, ERR_SEMANTIC_VALIDATION_EXPECTED, \
    ERR_SEMANTIC_REGION_MISSING

    def _semantic_pop_styles(self, dataset):
        dataset['styles_stack'].pop()

    @property
    def specified_style(self):
        """
        This is the resolution of the Style attributes that are directly linked to this element even via implicit
        inheritance of the style attributes
        :return:
        """
        return self._specified_style

    @property
    def computed_style(self):
        """
        In particular because of fontSize cascading semantics we need to be able to calculate the effective fontSize
        in any styled element container. Without it conversion from absolute values to relative would not be possible.
        This is a requirement for the EBU-TT-D conversion where only percentages are allowed in sizing attributes.
        To support converting the pixel/celll values that don't cascade to percentages that do the simplest
        approach is to compute the style in whatever crazy constellation of units it may be provided in and generate
        percentage based styles for p and span elements taking into account their relative cascading nature. Yes if
        this confused you please refer to the documentation of EBU-TT-D, EBU-TT-Live, TTML and whatever else TTML might
        refer to in terms of these style attributes.
        :return:
        """
        return self._computed_style

    @property
    def validated_styles(self):
        if self._validated_styles is None:

            raise SemanticValidationError(ERR_SEMANTIC_VALIDATION_EXPECTED)