From dc6b65c1616a2a2071338e1d8da90d59efd4efc9 Mon Sep 17 00:00:00 2001 From: OlteanuRares Date: Fri, 24 May 2024 11:32:57 +0300 Subject: [PATCH] fix bug caused by deleting wrong line --- docs/changelog.rst | 6 +++++- pycaption/scc/__init__.py | 1 + tests/fixtures/dfxp.py | 4 ++-- tests/test_scc.py | 4 ++-- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index 11b626d2..a80d63ff 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -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 diff --git a/pycaption/scc/__init__.py b/pycaption/scc/__init__.py index 9011ce7d..50e98f6f 100644 --- a/pycaption/scc/__init__.py +++ b/pycaption/scc/__init__.py @@ -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 # repetition diff --git a/tests/fixtures/dfxp.py b/tests/fixtures/dfxp.py index 901e9f12..714e5d52 100644 --- a/tests/fixtures/dfxp.py +++ b/tests/fixtures/dfxp.py @@ -920,10 +920,10 @@ def sample_dfxp_from_scc_output(): - + - + diff --git a/tests/test_scc.py b/tests/test_scc.py index 7bbba499..ece0e1ce 100644 --- a/tests/test_scc.py +++ b/tests/test_scc.py @@ -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()