Skip to content

Commit

Permalink
Clean-up documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
palemieux committed Dec 22, 2023
1 parent be33a01 commit 789c305
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
4 changes: 3 additions & 1 deletion src/main/python/ttconv/filters/doc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,15 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

"""Data model filter"""
"""Collects document instance filters"""

import importlib
import pkgutil
import os.path
import sys

# registers all document instance filters

for importer, package_name, _ in pkgutil.iter_modules([os.path.dirname(__file__)]):
full_name = f"{__name__}.{package_name}"
importlib.import_module(full_name)
2 changes: 1 addition & 1 deletion src/main/python/ttconv/filters/isd/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

"""Data model filter"""
"""Collects ISD filters"""



3 changes: 2 additions & 1 deletion src/main/python/ttconv/filters/remove_animations.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

"""Filter removing animations"""
"""Filter that remove animations"""

import logging
from typing import Dict, List, Type
Expand All @@ -41,6 +41,7 @@ def has_removed_animations(self) -> bool:
return self._has_removed_animations

def process_element(self, element: ContentElement, recursive = True):
"""Removes animations from content elements"""

for step in element.iter_animation_steps():
element.remove_animation_step(step)
Expand Down
7 changes: 4 additions & 3 deletions src/main/python/ttconv/filters/supported_style_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

"""Filter for style properties supported by the output"""
"""Filters style properties"""

import logging
from typing import Dict, List, Type
Expand All @@ -32,12 +32,13 @@
from ttconv.style_properties import StyleProperty

class SupportedStylePropertiesFilter:
"""Filter that remove unsupported style properties"""
"""Filter that removes unsupported style properties"""

def __init__(self, supported_style_properties: Dict[Type[StyleProperty], List]):
self.supported_style_properties = supported_style_properties

def process_initial_values(self, doc: ContentDocument):
"""Removes initial values that target unsupported style properties"""
for style_prop, value in list(doc.iter_initial_values()):

if style_prop in self.supported_style_properties:
Expand All @@ -49,7 +50,7 @@ def process_initial_values(self, doc: ContentDocument):
doc.put_initial_value(style_prop, None)

def process_element(self, element: ContentElement, recursive = True):
"""Filter element style properties"""
"""Removes unsupported style properties from content elements"""

for style_prop in list(element.iter_styles()):

Expand Down

0 comments on commit 789c305

Please sign in to comment.