Skip to content

Commit

Permalink
Fix document filter return type
Browse files Browse the repository at this point in the history
  • Loading branch information
palemieux committed Dec 22, 2023
1 parent fbe05b2 commit a1cb4bb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
2 changes: 0 additions & 2 deletions src/main/python/ttconv/filters/doc/lcd.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,5 +245,3 @@ def process(self, doc: ContentDocument) -> ContentDocument:

if doc.get_body() is not None and not self.config.preserve_text_align:
doc.get_body().set_style(StyleProperties.TextAlign, TextAlignType.center)

return doc
4 changes: 2 additions & 2 deletions src/main/python/ttconv/filters/document_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ class DocumentFilter:
def __init__(self, config: ModuleConfiguration) -> None:
self.config = config

def process(self, doc: ContentDocument) -> ContentDocument:
"""Processes the specified document in place and returns it."""
def process(self, doc: ContentDocument):
"""Processes the specified document in place."""
raise NotImplementedError

@classmethod
Expand Down
6 changes: 3 additions & 3 deletions src/test/python/test_lcd_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def test_region_merging(self):

filter = LCDFilter(LCDFilterConfig())

self.assertIs(filter.process(doc), doc)
self.assertIsNone(filter.process(doc))

self.assertSetEqual(
set(["r1", "r3", "r5"]),
Expand Down Expand Up @@ -256,7 +256,7 @@ def test_region_resizing(self):
# apply filter
filter = LCDFilter(LCDFilterConfig())

self.assertIs(filter.process(doc), doc)
self.assertIsNone(filter.process(doc))

self.assertSetEqual(
set(["r1", "r2"]),
Expand Down Expand Up @@ -318,7 +318,7 @@ def test_text_align(self):
# apply filter
filter = LCDFilter(LCDFilterConfig())

self.assertIs(filter.process(doc), doc)
self.assertIsNone(filter.process(doc))

self.assertIsNone(p1.get_style(styles.StyleProperties.TextAlign))
self.assertEqual(body.get_style(styles.StyleProperties.TextAlign), styles.TextAlignType.center)
Expand Down

0 comments on commit a1cb4bb

Please sign in to comment.