Skip to content

Commit

Permalink
Fix document filter return
Browse files Browse the repository at this point in the history
  • Loading branch information
palemieux committed Dec 22, 2023
1 parent 3cb8985 commit fbe05b2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/main/python/ttconv/filters/doc/lcd.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,3 +245,5 @@ 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
2 changes: 1 addition & 1 deletion src/main/python/ttconv/filters/document_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def __init__(self, config: ModuleConfiguration) -> None:
self.config = config

def process(self, doc: ContentDocument) -> ContentDocument:
"""Process the specified doc and returns it."""
"""Processes the specified document in place and returns it."""
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())

filter.process(doc)
self.assertIs(filter.process(doc), 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())

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

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

filter.process(doc)
self.assertIs(filter.process(doc), 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 fbe05b2

Please sign in to comment.