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.
Files changed (58) hide show
  1. {pycaption-2.2.6/pycaption.egg-info → pycaption-2.2.7}/PKG-INFO +1 -1
  2. {pycaption-2.2.6 → pycaption-2.2.7}/pycaption/scc/constants.py +6 -0
  3. {pycaption-2.2.6 → pycaption-2.2.7}/pycaption/scc/specialized_collections.py +9 -2
  4. {pycaption-2.2.6 → pycaption-2.2.7/pycaption.egg-info}/PKG-INFO +1 -1
  5. {pycaption-2.2.6 → pycaption-2.2.7}/setup.py +1 -1
  6. {pycaption-2.2.6 → pycaption-2.2.7}/tests/test_scc.py +3 -3
  7. {pycaption-2.2.6 → pycaption-2.2.7}/LICENSE +0 -0
  8. {pycaption-2.2.6 → pycaption-2.2.7}/MANIFEST.in +0 -0
  9. {pycaption-2.2.6 → pycaption-2.2.7}/README.rst +0 -0
  10. {pycaption-2.2.6 → pycaption-2.2.7}/pycaption/__init__.py +0 -0
  11. {pycaption-2.2.6 → pycaption-2.2.7}/pycaption/base.py +0 -0
  12. {pycaption-2.2.6 → pycaption-2.2.7}/pycaption/dfxp/__init__.py +0 -0
  13. {pycaption-2.2.6 → pycaption-2.2.7}/pycaption/dfxp/base.py +0 -0
  14. {pycaption-2.2.6 → pycaption-2.2.7}/pycaption/dfxp/extras.py +0 -0
  15. {pycaption-2.2.6 → pycaption-2.2.7}/pycaption/english.pickle +0 -0
  16. {pycaption-2.2.6 → pycaption-2.2.7}/pycaption/exceptions.py +0 -0
  17. {pycaption-2.2.6 → pycaption-2.2.7}/pycaption/geometry.py +0 -0
  18. {pycaption-2.2.6 → pycaption-2.2.7}/pycaption/microdvd.py +0 -0
  19. {pycaption-2.2.6 → pycaption-2.2.7}/pycaption/sami.py +0 -0
  20. {pycaption-2.2.6 → pycaption-2.2.7}/pycaption/scc/__init__.py +0 -0
  21. {pycaption-2.2.6 → pycaption-2.2.7}/pycaption/scc/state_machines.py +0 -0
  22. {pycaption-2.2.6 → pycaption-2.2.7}/pycaption/scc/translator.py +0 -0
  23. {pycaption-2.2.6 → pycaption-2.2.7}/pycaption/srt.py +0 -0
  24. {pycaption-2.2.6 → pycaption-2.2.7}/pycaption/transcript.py +0 -0
  25. {pycaption-2.2.6 → pycaption-2.2.7}/pycaption/utils.py +0 -0
  26. {pycaption-2.2.6 → pycaption-2.2.7}/pycaption/webvtt.py +0 -0
  27. {pycaption-2.2.6 → pycaption-2.2.7}/pycaption.egg-info/SOURCES.txt +0 -0
  28. {pycaption-2.2.6 → pycaption-2.2.7}/pycaption.egg-info/dependency_links.txt +0 -0
  29. {pycaption-2.2.6 → pycaption-2.2.7}/pycaption.egg-info/requires.txt +0 -0
  30. {pycaption-2.2.6 → pycaption-2.2.7}/pycaption.egg-info/top_level.txt +0 -0
  31. {pycaption-2.2.6 → pycaption-2.2.7}/setup.cfg +0 -0
  32. {pycaption-2.2.6 → pycaption-2.2.7}/tests/__init__.py +0 -0
  33. {pycaption-2.2.6 → pycaption-2.2.7}/tests/conftest.py +0 -0
  34. {pycaption-2.2.6 → pycaption-2.2.7}/tests/fixtures/__init__.py +0 -0
  35. {pycaption-2.2.6 → pycaption-2.2.7}/tests/fixtures/dfxp.py +0 -0
  36. {pycaption-2.2.6 → pycaption-2.2.7}/tests/fixtures/microdvd.py +0 -0
  37. {pycaption-2.2.6 → pycaption-2.2.7}/tests/fixtures/sami.py +0 -0
  38. {pycaption-2.2.6 → pycaption-2.2.7}/tests/fixtures/scc.py +0 -0
  39. {pycaption-2.2.6 → pycaption-2.2.7}/tests/fixtures/srt.py +0 -0
  40. {pycaption-2.2.6 → pycaption-2.2.7}/tests/fixtures/translated_scc.py +0 -0
  41. {pycaption-2.2.6 → pycaption-2.2.7}/tests/fixtures/webvtt.py +0 -0
  42. {pycaption-2.2.6 → pycaption-2.2.7}/tests/mixins.py +0 -0
  43. {pycaption-2.2.6 → pycaption-2.2.7}/tests/test_base.py +0 -0
  44. {pycaption-2.2.6 → pycaption-2.2.7}/tests/test_dfxp.py +0 -0
  45. {pycaption-2.2.6 → pycaption-2.2.7}/tests/test_dfxp_conversion.py +0 -0
  46. {pycaption-2.2.6 → pycaption-2.2.7}/tests/test_dfxp_extras.py +0 -0
  47. {pycaption-2.2.6 → pycaption-2.2.7}/tests/test_functions.py +0 -0
  48. {pycaption-2.2.6 → pycaption-2.2.7}/tests/test_geometry.py +0 -0
  49. {pycaption-2.2.6 → pycaption-2.2.7}/tests/test_microdvd.py +0 -0
  50. {pycaption-2.2.6 → pycaption-2.2.7}/tests/test_microdvd_conversion.py +0 -0
  51. {pycaption-2.2.6 → pycaption-2.2.7}/tests/test_sami.py +0 -0
  52. {pycaption-2.2.6 → pycaption-2.2.7}/tests/test_sami_conversion.py +0 -0
  53. {pycaption-2.2.6 → pycaption-2.2.7}/tests/test_scc_conversion.py +0 -0
  54. {pycaption-2.2.6 → pycaption-2.2.7}/tests/test_scc_translator.py +0 -0
  55. {pycaption-2.2.6 → pycaption-2.2.7}/tests/test_srt.py +0 -0
  56. {pycaption-2.2.6 → pycaption-2.2.7}/tests/test_srt_conversion.py +0 -0
  57. {pycaption-2.2.6 → pycaption-2.2.7}/tests/test_webvtt.py +0 -0
  58. {pycaption-2.2.6 → pycaption-2.2.7}/tests/test_webvtt_conversion.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pycaption
3
- Version: 2.2.6
3
+ Version: 2.2.7
4
4
  Summary: Closed caption converter
5
5
  Author: Joe Norton
6
6
  Author-email: joey@nortoncrew.com
@@ -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.get_text(), layout_info=layout_info),
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(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pycaption
3
- Version: 2.2.6
3
+ Version: 2.2.7
4
4
  Summary: Closed caption converter
5
5
  Author: Joe Norton
6
6
  Author-email: joey@nortoncrew.com
@@ -24,7 +24,7 @@ transcript_dependencies = [
24
24
 
25
25
  setup(
26
26
  name='pycaption',
27
- version='2.2.6',
27
+ version='2.2.7',
28
28
  description='Closed caption converter',
29
29
  long_description=open(README_PATH).read(),
30
30
  author='Joe Norton',
@@ -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