pycaption 2.2.21__tar.gz → 2.2.22__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pycaption-2.2.21/pycaption.egg-info → pycaption-2.2.22}/PKG-INFO +1 -1
- {pycaption-2.2.21 → pycaption-2.2.22}/pycaption/scc/__init__.py +11 -2
- {pycaption-2.2.21 → pycaption-2.2.22/pycaption.egg-info}/PKG-INFO +1 -1
- {pycaption-2.2.21 → pycaption-2.2.22}/setup.py +1 -1
- {pycaption-2.2.21 → pycaption-2.2.22}/tests/conftest.py +1 -0
- {pycaption-2.2.21 → pycaption-2.2.22}/tests/fixtures/dfxp.py +1 -1
- {pycaption-2.2.21 → pycaption-2.2.22}/tests/fixtures/scc.py +16 -0
- {pycaption-2.2.21 → pycaption-2.2.22}/tests/test_scc.py +18 -0
- {pycaption-2.2.21 → pycaption-2.2.22}/LICENSE +0 -0
- {pycaption-2.2.21 → pycaption-2.2.22}/MANIFEST.in +0 -0
- {pycaption-2.2.21 → pycaption-2.2.22}/README.rst +0 -0
- {pycaption-2.2.21 → pycaption-2.2.22}/pycaption/__init__.py +0 -0
- {pycaption-2.2.21 → pycaption-2.2.22}/pycaption/base.py +0 -0
- {pycaption-2.2.21 → pycaption-2.2.22}/pycaption/dfxp/__init__.py +0 -0
- {pycaption-2.2.21 → pycaption-2.2.22}/pycaption/dfxp/base.py +0 -0
- {pycaption-2.2.21 → pycaption-2.2.22}/pycaption/dfxp/extras.py +0 -0
- {pycaption-2.2.21 → pycaption-2.2.22}/pycaption/exceptions.py +0 -0
- {pycaption-2.2.21 → pycaption-2.2.22}/pycaption/geometry.py +0 -0
- {pycaption-2.2.21 → pycaption-2.2.22}/pycaption/microdvd.py +0 -0
- {pycaption-2.2.21 → pycaption-2.2.22}/pycaption/sami.py +0 -0
- {pycaption-2.2.21 → pycaption-2.2.22}/pycaption/scc/constants.py +0 -0
- {pycaption-2.2.21 → pycaption-2.2.22}/pycaption/scc/specialized_collections.py +0 -0
- {pycaption-2.2.21 → pycaption-2.2.22}/pycaption/scc/state_machines.py +0 -0
- {pycaption-2.2.21 → pycaption-2.2.22}/pycaption/scc/translator.py +0 -0
- {pycaption-2.2.21 → pycaption-2.2.22}/pycaption/srt.py +0 -0
- {pycaption-2.2.21 → pycaption-2.2.22}/pycaption/transcript.py +0 -0
- {pycaption-2.2.21 → pycaption-2.2.22}/pycaption/utils.py +0 -0
- {pycaption-2.2.21 → pycaption-2.2.22}/pycaption/webvtt.py +0 -0
- {pycaption-2.2.21 → pycaption-2.2.22}/pycaption.egg-info/SOURCES.txt +0 -0
- {pycaption-2.2.21 → pycaption-2.2.22}/pycaption.egg-info/dependency_links.txt +0 -0
- {pycaption-2.2.21 → pycaption-2.2.22}/pycaption.egg-info/requires.txt +0 -0
- {pycaption-2.2.21 → pycaption-2.2.22}/pycaption.egg-info/top_level.txt +0 -0
- {pycaption-2.2.21 → pycaption-2.2.22}/setup.cfg +0 -0
- {pycaption-2.2.21 → pycaption-2.2.22}/tests/__init__.py +0 -0
- {pycaption-2.2.21 → pycaption-2.2.22}/tests/fixtures/__init__.py +0 -0
- {pycaption-2.2.21 → pycaption-2.2.22}/tests/fixtures/microdvd.py +0 -0
- {pycaption-2.2.21 → pycaption-2.2.22}/tests/fixtures/sami.py +0 -0
- {pycaption-2.2.21 → pycaption-2.2.22}/tests/fixtures/srt.py +0 -0
- {pycaption-2.2.21 → pycaption-2.2.22}/tests/fixtures/translated_scc.py +0 -0
- {pycaption-2.2.21 → pycaption-2.2.22}/tests/fixtures/webvtt.py +0 -0
- {pycaption-2.2.21 → pycaption-2.2.22}/tests/mixins.py +0 -0
- {pycaption-2.2.21 → pycaption-2.2.22}/tests/test_base.py +0 -0
- {pycaption-2.2.21 → pycaption-2.2.22}/tests/test_dfxp.py +0 -0
- {pycaption-2.2.21 → pycaption-2.2.22}/tests/test_dfxp_conversion.py +0 -0
- {pycaption-2.2.21 → pycaption-2.2.22}/tests/test_dfxp_extras.py +0 -0
- {pycaption-2.2.21 → pycaption-2.2.22}/tests/test_functions.py +0 -0
- {pycaption-2.2.21 → pycaption-2.2.22}/tests/test_geometry.py +0 -0
- {pycaption-2.2.21 → pycaption-2.2.22}/tests/test_microdvd.py +0 -0
- {pycaption-2.2.21 → pycaption-2.2.22}/tests/test_microdvd_conversion.py +0 -0
- {pycaption-2.2.21 → pycaption-2.2.22}/tests/test_sami.py +0 -0
- {pycaption-2.2.21 → pycaption-2.2.22}/tests/test_sami_conversion.py +0 -0
- {pycaption-2.2.21 → pycaption-2.2.22}/tests/test_scc_conversion.py +0 -0
- {pycaption-2.2.21 → pycaption-2.2.22}/tests/test_scc_translator.py +0 -0
- {pycaption-2.2.21 → pycaption-2.2.22}/tests/test_srt.py +0 -0
- {pycaption-2.2.21 → pycaption-2.2.22}/tests/test_srt_conversion.py +0 -0
- {pycaption-2.2.21 → pycaption-2.2.22}/tests/test_webvtt.py +0 -0
- {pycaption-2.2.21 → pycaption-2.2.22}/tests/test_webvtt_conversion.py +0 -0
|
@@ -484,8 +484,17 @@ class SCCReader(BaseReader):
|
|
|
484
484
|
|
|
485
485
|
# 942c - Erase Displayed Memory - Clear the current screen of any
|
|
486
486
|
# displayed captions or text.
|
|
487
|
-
elif word == "942c"
|
|
488
|
-
|
|
487
|
+
elif word == "942c":
|
|
488
|
+
edm_time = self.time_translator.get_time()
|
|
489
|
+
if self.pop_ons_queue:
|
|
490
|
+
self._pop_on(end=edm_time)
|
|
491
|
+
if self.buffer_dict.active_key in ("paint", "roll") \
|
|
492
|
+
and not self.buffer.is_empty():
|
|
493
|
+
self.caption_stash.create_and_store(
|
|
494
|
+
self.buffer, self.time, edm_time)
|
|
495
|
+
self.buffer = self.node_creator_factory.new_creator()
|
|
496
|
+
self.node_creator_factory.position_tracker.reset_for_new_caption()
|
|
497
|
+
self.time = edm_time
|
|
489
498
|
|
|
490
499
|
# If command is not one of the aforementioned, add it to buffer
|
|
491
500
|
else:
|
|
@@ -123,6 +123,7 @@ from tests.fixtures.scc import ( # noqa: F401
|
|
|
123
123
|
sample_scc_with_spaces_at_eol_pop,
|
|
124
124
|
sample_scc_with_spaces_at_eol_roll,
|
|
125
125
|
sample_scc_with_unknown_commands,
|
|
126
|
+
sample_scc_paint_on_edm,
|
|
126
127
|
scc_that_generates_webvtt_with_proper_newlines,
|
|
127
128
|
)
|
|
128
129
|
from tests.fixtures.srt import (
|
|
@@ -963,7 +963,7 @@ def sample_dfxp_from_scc_output():
|
|
|
963
963
|
<p begin="00:00:20.086" end="00:00:22.088" region="r9" style="default">
|
|
964
964
|
2323
|
|
965
965
|
</p>
|
|
966
|
-
<p begin="00:00:22.088" end="00:00:
|
|
966
|
+
<p begin="00:00:22.088" end="00:00:36.169" region="r10" style="default">
|
|
967
967
|
4545<br/>
|
|
968
968
|
6767<br/>
|
|
969
969
|
8989
|
|
@@ -643,3 +643,19 @@ Scenarist_SCC V1.0
|
|
|
643
643
|
00:00:01:24 9429 91d0 c180 c220 91e0 c1c2 2020 2080 92c2 c1c2 2080
|
|
644
644
|
|
|
645
645
|
"""
|
|
646
|
+
|
|
647
|
+
|
|
648
|
+
@pytest.fixture(scope="session")
|
|
649
|
+
def sample_scc_paint_on_edm():
|
|
650
|
+
return """\
|
|
651
|
+
Scenarist_SCC V1.0
|
|
652
|
+
|
|
653
|
+
00:00:00;00 9429 4920 f468 e96e 6b80
|
|
654
|
+
|
|
655
|
+
00:00:01;00 942c
|
|
656
|
+
|
|
657
|
+
00:00:02;00 9429 c8e5 ecec ef80
|
|
658
|
+
|
|
659
|
+
00:00:04;00 942c
|
|
660
|
+
|
|
661
|
+
"""
|
|
@@ -1000,3 +1000,21 @@ class TestTimingCorrectingCaptionList:
|
|
|
1000
1000
|
num_captions = len(caption_set.get_captions("en-US"))
|
|
1001
1001
|
|
|
1002
1002
|
assert num_captions == 2
|
|
1003
|
+
|
|
1004
|
+
def test_paint_on_edm_erases_displayed(self, sample_scc_paint_on_edm):
|
|
1005
|
+
caption_set = SCCReader().read(sample_scc_paint_on_edm)
|
|
1006
|
+
captions = caption_set.get_captions("en-US")
|
|
1007
|
+
|
|
1008
|
+
assert len(captions) == 2
|
|
1009
|
+
|
|
1010
|
+
texts = [
|
|
1011
|
+
node.content
|
|
1012
|
+
for caption in captions
|
|
1013
|
+
for node in caption.nodes
|
|
1014
|
+
if node.type_ == CaptionNode.TEXT
|
|
1015
|
+
]
|
|
1016
|
+
assert texts == ["I think", "Hello"]
|
|
1017
|
+
|
|
1018
|
+
assert captions[0].end > captions[0].start
|
|
1019
|
+
assert captions[1].end > captions[1].start
|
|
1020
|
+
assert captions[0].end <= captions[1].start
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|