Skip to content

Commit e9c99c7

Browse files
authored
Merge pull request #338 from pbs/OCTO-11001=space-to-mid-row-codes
fix bug caused by deleting wrong line
2 parents 8425158 + dc6b65c commit e9c99c7

File tree

4 files changed

+10
-5
lines changed

4 files changed

+10
-5
lines changed

docs/changelog.rst

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
Changelog
22
---------
3-
2.2.9
3+
2.2.10
44
^^^^^
55
- A space should not be placed before a mid row code if it follows a PAC command or a Tab Offset
66
- The backspace command should be treated like other commands and duplicates should be skipped if PAC commands are duplicated
77

8+
2.2.9
9+
^^^^^
10+
- Yanked.
11+
812
2.2.8
913
^^^^^
1014
- Honor backspaces on captions in scc files

pycaption/scc/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,7 @@ def _handle_double_command(self, word, pacs_are_doubled):
361361
doubled_types = doubled_types or word in SPECIAL_CHARS or word in EXTENDED_CHARS
362362

363363
if doubled_types and word == self.last_command:
364+
self.last_command = ''
364365
return True
365366
# Fix for the <position> <tab offset> <position> <tab offset>
366367
# repetition

tests/fixtures/dfxp.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -920,10 +920,10 @@ def sample_dfxp_from_scc_output():
920920
<region tts:displayAlign="before" tts:origin="40% 53%" tts:textAlign="left" xml:id="r5"/>
921921
<region tts:displayAlign="before" tts:origin="70% 17%" tts:textAlign="left" xml:id="r6"/>
922922
<region tts:displayAlign="before" tts:origin="20% 35%" tts:textAlign="left" xml:id="r7"/>
923-
<region tts:displayAlign="before" tts:origin="25% 83%" tts:textAlign="left" xml:id="r8"/>
923+
<region tts:displayAlign="before" tts:origin="20% 83%" tts:textAlign="left" xml:id="r8"/>
924924
<region tts:displayAlign="before" tts:origin="70% 11%" tts:textAlign="left" xml:id="r9"/>
925925
<region tts:displayAlign="before" tts:origin="40% 41%" tts:textAlign="left" xml:id="r10"/>
926-
<region tts:displayAlign="before" tts:origin="25% 71%" tts:textAlign="left" xml:id="r11"/>
926+
<region tts:displayAlign="before" tts:origin="20% 71%" tts:textAlign="left" xml:id="r11"/>
927927
</layout>
928928
</head>
929929
<body>

tests/test_scc.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,10 @@ def test_positioning(self, sample_scc_multiple_positioning):
7777
((40.0, UnitEnum.PERCENT), (53.0, UnitEnum.PERCENT)),
7878
((70.0, UnitEnum.PERCENT), (17.0, UnitEnum.PERCENT)),
7979
((20.0, UnitEnum.PERCENT), (35.0, UnitEnum.PERCENT)),
80-
((25.0, UnitEnum.PERCENT), (83.0, UnitEnum.PERCENT)),
80+
((20.0, UnitEnum.PERCENT), (83.0, UnitEnum.PERCENT)),
8181
((70.0, UnitEnum.PERCENT), (11.0, UnitEnum.PERCENT)),
8282
((40.0, UnitEnum.PERCENT), (41.0, UnitEnum.PERCENT)),
83-
((25.0, UnitEnum.PERCENT), (71.0, UnitEnum.PERCENT))
83+
((20.0, UnitEnum.PERCENT), (71.0, UnitEnum.PERCENT))
8484
]
8585
actual_positioning = [
8686
caption_.layout_info.origin.serialized()

0 commit comments

Comments
 (0)