pycaption 2.2.6__tar.gz → 2.2.7__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.6/pycaption.egg-info → pycaption-2.2.7}/PKG-INFO +1 -1
- {pycaption-2.2.6 → pycaption-2.2.7}/pycaption/scc/constants.py +6 -0
- {pycaption-2.2.6 → pycaption-2.2.7}/pycaption/scc/specialized_collections.py +9 -2
- {pycaption-2.2.6 → pycaption-2.2.7/pycaption.egg-info}/PKG-INFO +1 -1
- {pycaption-2.2.6 → pycaption-2.2.7}/setup.py +1 -1
- {pycaption-2.2.6 → pycaption-2.2.7}/tests/test_scc.py +3 -3
- {pycaption-2.2.6 → pycaption-2.2.7}/LICENSE +0 -0
- {pycaption-2.2.6 → pycaption-2.2.7}/MANIFEST.in +0 -0
- {pycaption-2.2.6 → pycaption-2.2.7}/README.rst +0 -0
- {pycaption-2.2.6 → pycaption-2.2.7}/pycaption/__init__.py +0 -0
- {pycaption-2.2.6 → pycaption-2.2.7}/pycaption/base.py +0 -0
- {pycaption-2.2.6 → pycaption-2.2.7}/pycaption/dfxp/__init__.py +0 -0
- {pycaption-2.2.6 → pycaption-2.2.7}/pycaption/dfxp/base.py +0 -0
- {pycaption-2.2.6 → pycaption-2.2.7}/pycaption/dfxp/extras.py +0 -0
- {pycaption-2.2.6 → pycaption-2.2.7}/pycaption/english.pickle +0 -0
- {pycaption-2.2.6 → pycaption-2.2.7}/pycaption/exceptions.py +0 -0
- {pycaption-2.2.6 → pycaption-2.2.7}/pycaption/geometry.py +0 -0
- {pycaption-2.2.6 → pycaption-2.2.7}/pycaption/microdvd.py +0 -0
- {pycaption-2.2.6 → pycaption-2.2.7}/pycaption/sami.py +0 -0
- {pycaption-2.2.6 → pycaption-2.2.7}/pycaption/scc/__init__.py +0 -0
- {pycaption-2.2.6 → pycaption-2.2.7}/pycaption/scc/state_machines.py +0 -0
- {pycaption-2.2.6 → pycaption-2.2.7}/pycaption/scc/translator.py +0 -0
- {pycaption-2.2.6 → pycaption-2.2.7}/pycaption/srt.py +0 -0
- {pycaption-2.2.6 → pycaption-2.2.7}/pycaption/transcript.py +0 -0
- {pycaption-2.2.6 → pycaption-2.2.7}/pycaption/utils.py +0 -0
- {pycaption-2.2.6 → pycaption-2.2.7}/pycaption/webvtt.py +0 -0
- {pycaption-2.2.6 → pycaption-2.2.7}/pycaption.egg-info/SOURCES.txt +0 -0
- {pycaption-2.2.6 → pycaption-2.2.7}/pycaption.egg-info/dependency_links.txt +0 -0
- {pycaption-2.2.6 → pycaption-2.2.7}/pycaption.egg-info/requires.txt +0 -0
- {pycaption-2.2.6 → pycaption-2.2.7}/pycaption.egg-info/top_level.txt +0 -0
- {pycaption-2.2.6 → pycaption-2.2.7}/setup.cfg +0 -0
- {pycaption-2.2.6 → pycaption-2.2.7}/tests/__init__.py +0 -0
- {pycaption-2.2.6 → pycaption-2.2.7}/tests/conftest.py +0 -0
- {pycaption-2.2.6 → pycaption-2.2.7}/tests/fixtures/__init__.py +0 -0
- {pycaption-2.2.6 → pycaption-2.2.7}/tests/fixtures/dfxp.py +0 -0
- {pycaption-2.2.6 → pycaption-2.2.7}/tests/fixtures/microdvd.py +0 -0
- {pycaption-2.2.6 → pycaption-2.2.7}/tests/fixtures/sami.py +0 -0
- {pycaption-2.2.6 → pycaption-2.2.7}/tests/fixtures/scc.py +0 -0
- {pycaption-2.2.6 → pycaption-2.2.7}/tests/fixtures/srt.py +0 -0
- {pycaption-2.2.6 → pycaption-2.2.7}/tests/fixtures/translated_scc.py +0 -0
- {pycaption-2.2.6 → pycaption-2.2.7}/tests/fixtures/webvtt.py +0 -0
- {pycaption-2.2.6 → pycaption-2.2.7}/tests/mixins.py +0 -0
- {pycaption-2.2.6 → pycaption-2.2.7}/tests/test_base.py +0 -0
- {pycaption-2.2.6 → pycaption-2.2.7}/tests/test_dfxp.py +0 -0
- {pycaption-2.2.6 → pycaption-2.2.7}/tests/test_dfxp_conversion.py +0 -0
- {pycaption-2.2.6 → pycaption-2.2.7}/tests/test_dfxp_extras.py +0 -0
- {pycaption-2.2.6 → pycaption-2.2.7}/tests/test_functions.py +0 -0
- {pycaption-2.2.6 → pycaption-2.2.7}/tests/test_geometry.py +0 -0
- {pycaption-2.2.6 → pycaption-2.2.7}/tests/test_microdvd.py +0 -0
- {pycaption-2.2.6 → pycaption-2.2.7}/tests/test_microdvd_conversion.py +0 -0
- {pycaption-2.2.6 → pycaption-2.2.7}/tests/test_sami.py +0 -0
- {pycaption-2.2.6 → pycaption-2.2.7}/tests/test_sami_conversion.py +0 -0
- {pycaption-2.2.6 → pycaption-2.2.7}/tests/test_scc_conversion.py +0 -0
- {pycaption-2.2.6 → pycaption-2.2.7}/tests/test_scc_translator.py +0 -0
- {pycaption-2.2.6 → pycaption-2.2.7}/tests/test_srt.py +0 -0
- {pycaption-2.2.6 → pycaption-2.2.7}/tests/test_srt_conversion.py +0 -0
- {pycaption-2.2.6 → pycaption-2.2.7}/tests/test_webvtt.py +0 -0
- {pycaption-2.2.6 → pycaption-2.2.7}/tests/test_webvtt_conversion.py +0 -0
|
@@ -1046,3 +1046,9 @@ INCONVERTIBLE_TO_ASCII_EXTENDED_CHARS_ASSOCIATION = {
|
|
|
1046
1046
|
'└': ["+"],
|
|
1047
1047
|
'┘': ["+"]
|
|
1048
1048
|
}
|
|
1049
|
+
|
|
1050
|
+
MID_ROW_CODES = [
|
|
1051
|
+
"9120", "91a1", "91a2", "9123", "91a4", "9125", "9126",
|
|
1052
|
+
"91a7", "91a8", "9129", "912a", "91ab", "912c", "91ad",
|
|
1053
|
+
"97ae", "972f", "91ae", "912f", "94a8"
|
|
1054
|
+
]
|
|
@@ -8,7 +8,8 @@ from ..geometry import (
|
|
|
8
8
|
)
|
|
9
9
|
from .constants import (
|
|
10
10
|
PAC_BYTES_TO_POSITIONING_MAP, COMMANDS, PAC_TAB_OFFSET_COMMANDS,
|
|
11
|
-
MICROSECONDS_PER_CODEWORD, INCONVERTIBLE_TO_ASCII_EXTENDED_CHARS_ASSOCIATION
|
|
11
|
+
MICROSECONDS_PER_CODEWORD, INCONVERTIBLE_TO_ASCII_EXTENDED_CHARS_ASSOCIATION,
|
|
12
|
+
MID_ROW_CODES
|
|
12
13
|
)
|
|
13
14
|
|
|
14
15
|
PopOnCue = collections.namedtuple("PopOnCue", "buffer, start, end")
|
|
@@ -254,7 +255,7 @@ class CaptionCreator:
|
|
|
254
255
|
layout_info = _get_layout_from_tuple(instruction.position)
|
|
255
256
|
caption.nodes.append(
|
|
256
257
|
CaptionNode.create_text(
|
|
257
|
-
instruction.
|
|
258
|
+
instruction.text, layout_info=layout_info),
|
|
258
259
|
)
|
|
259
260
|
caption.layout_info = layout_info
|
|
260
261
|
|
|
@@ -346,6 +347,12 @@ class InstructionNodeCreator:
|
|
|
346
347
|
|
|
347
348
|
text = COMMANDS.get(command, '')
|
|
348
349
|
|
|
350
|
+
if command in MID_ROW_CODES:
|
|
351
|
+
for node in self._collection[::-1]:
|
|
352
|
+
if node.is_text_node():
|
|
353
|
+
node.text += ' '
|
|
354
|
+
break
|
|
355
|
+
|
|
349
356
|
if 'italic' in text:
|
|
350
357
|
if 'end' not in text:
|
|
351
358
|
self._collection.append(
|
|
@@ -206,10 +206,10 @@ class TestSCCReader(ReaderTestingMixIn):
|
|
|
206
206
|
|
|
207
207
|
def test_skip_duplicate_tab_offset(self, sample_scc_duplicate_tab_offset):
|
|
208
208
|
expected_lines = [
|
|
209
|
-
'[Radio reporter]',
|
|
210
|
-
'The I-10 Santa Monica Freeway',
|
|
209
|
+
'[Radio reporter] ',
|
|
210
|
+
'The I-10 Santa Monica Freeway ',
|
|
211
211
|
'westbound is jammed,',
|
|
212
|
-
'due to a three-car accident',
|
|
212
|
+
'due to a three-car accident ',
|
|
213
213
|
'blocking lanes 1 and 2',
|
|
214
214
|
]
|
|
215
215
|
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|