Skip to content

Commit

Permalink
Merge pull request #338 from pbs/OCTO-11001=space-to-mid-row-codes
Browse files Browse the repository at this point in the history
fix bug caused by deleting wrong line
  • Loading branch information
OlteanuRares authored May 24, 2024
2 parents 8425158 + dc6b65c commit e9c99c7
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
6 changes: 5 additions & 1 deletion docs/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
Changelog
---------
2.2.9
2.2.10
^^^^^
- A space should not be placed before a mid row code if it follows a PAC command or a Tab Offset
- The backspace command should be treated like other commands and duplicates should be skipped if PAC commands are duplicated

2.2.9
^^^^^
- Yanked.

2.2.8
^^^^^
- Honor backspaces on captions in scc files
Expand Down
1 change: 1 addition & 0 deletions pycaption/scc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,7 @@ def _handle_double_command(self, word, pacs_are_doubled):
doubled_types = doubled_types or word in SPECIAL_CHARS or word in EXTENDED_CHARS

if doubled_types and word == self.last_command:
self.last_command = ''
return True
# Fix for the <position> <tab offset> <position> <tab offset>
# repetition
Expand Down
4 changes: 2 additions & 2 deletions tests/fixtures/dfxp.py
Original file line number Diff line number Diff line change
Expand Up @@ -920,10 +920,10 @@ def sample_dfxp_from_scc_output():
<region tts:displayAlign="before" tts:origin="40% 53%" tts:textAlign="left" xml:id="r5"/>
<region tts:displayAlign="before" tts:origin="70% 17%" tts:textAlign="left" xml:id="r6"/>
<region tts:displayAlign="before" tts:origin="20% 35%" tts:textAlign="left" xml:id="r7"/>
<region tts:displayAlign="before" tts:origin="25% 83%" tts:textAlign="left" xml:id="r8"/>
<region tts:displayAlign="before" tts:origin="20% 83%" tts:textAlign="left" xml:id="r8"/>
<region tts:displayAlign="before" tts:origin="70% 11%" tts:textAlign="left" xml:id="r9"/>
<region tts:displayAlign="before" tts:origin="40% 41%" tts:textAlign="left" xml:id="r10"/>
<region tts:displayAlign="before" tts:origin="25% 71%" tts:textAlign="left" xml:id="r11"/>
<region tts:displayAlign="before" tts:origin="20% 71%" tts:textAlign="left" xml:id="r11"/>
</layout>
</head>
<body>
Expand Down
4 changes: 2 additions & 2 deletions tests/test_scc.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ def test_positioning(self, sample_scc_multiple_positioning):
((40.0, UnitEnum.PERCENT), (53.0, UnitEnum.PERCENT)),
((70.0, UnitEnum.PERCENT), (17.0, UnitEnum.PERCENT)),
((20.0, UnitEnum.PERCENT), (35.0, UnitEnum.PERCENT)),
((25.0, UnitEnum.PERCENT), (83.0, UnitEnum.PERCENT)),
((20.0, UnitEnum.PERCENT), (83.0, UnitEnum.PERCENT)),
((70.0, UnitEnum.PERCENT), (11.0, UnitEnum.PERCENT)),
((40.0, UnitEnum.PERCENT), (41.0, UnitEnum.PERCENT)),
((25.0, UnitEnum.PERCENT), (71.0, UnitEnum.PERCENT))
((20.0, UnitEnum.PERCENT), (71.0, UnitEnum.PERCENT))
]
actual_positioning = [
caption_.layout_info.origin.serialized()
Expand Down

0 comments on commit e9c99c7

Please sign in to comment.