pycaption 2.2.26__tar.gz → 2.2.28__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 (61) hide show
  1. {pycaption-2.2.26/pycaption.egg-info → pycaption-2.2.28}/PKG-INFO +1 -1
  2. {pycaption-2.2.26 → pycaption-2.2.28}/pycaption/dfxp/base.py +1 -1
  3. {pycaption-2.2.26 → pycaption-2.2.28}/pycaption/geometry.py +22 -3
  4. {pycaption-2.2.26 → pycaption-2.2.28}/pycaption/sami.py +1 -1
  5. pycaption-2.2.28/pycaption/webvtt.py +1130 -0
  6. {pycaption-2.2.26 → pycaption-2.2.28/pycaption.egg-info}/PKG-INFO +1 -1
  7. {pycaption-2.2.26 → pycaption-2.2.28}/setup.py +1 -1
  8. {pycaption-2.2.26 → pycaption-2.2.28}/tests/conftest.py +24 -4
  9. {pycaption-2.2.26 → pycaption-2.2.28}/tests/fixtures/webvtt.py +217 -3
  10. {pycaption-2.2.26 → pycaption-2.2.28}/tests/test_dfxp.py +3 -0
  11. {pycaption-2.2.26 → pycaption-2.2.28}/tests/test_scc.py +4 -0
  12. pycaption-2.2.28/tests/test_webvtt.py +1010 -0
  13. pycaption-2.2.28/tests/test_webvtt_conversion.py +331 -0
  14. pycaption-2.2.26/pycaption/webvtt.py +0 -624
  15. pycaption-2.2.26/tests/test_webvtt.py +0 -378
  16. pycaption-2.2.26/tests/test_webvtt_conversion.py +0 -116
  17. {pycaption-2.2.26 → pycaption-2.2.28}/LICENSE +0 -0
  18. {pycaption-2.2.26 → pycaption-2.2.28}/MANIFEST.in +0 -0
  19. {pycaption-2.2.26 → pycaption-2.2.28}/README.rst +0 -0
  20. {pycaption-2.2.26 → pycaption-2.2.28}/pycaption/__init__.py +0 -0
  21. {pycaption-2.2.26 → pycaption-2.2.28}/pycaption/base.py +0 -0
  22. {pycaption-2.2.26 → pycaption-2.2.28}/pycaption/dfxp/__init__.py +0 -0
  23. {pycaption-2.2.26 → pycaption-2.2.28}/pycaption/dfxp/extras.py +0 -0
  24. {pycaption-2.2.26 → pycaption-2.2.28}/pycaption/exceptions.py +0 -0
  25. {pycaption-2.2.26 → pycaption-2.2.28}/pycaption/microdvd.py +0 -0
  26. {pycaption-2.2.26 → pycaption-2.2.28}/pycaption/scc/__init__.py +0 -0
  27. {pycaption-2.2.26 → pycaption-2.2.28}/pycaption/scc/constants.py +0 -0
  28. {pycaption-2.2.26 → pycaption-2.2.28}/pycaption/scc/specialized_collections.py +0 -0
  29. {pycaption-2.2.26 → pycaption-2.2.28}/pycaption/scc/state_machines.py +0 -0
  30. {pycaption-2.2.26 → pycaption-2.2.28}/pycaption/scc/translator.py +0 -0
  31. {pycaption-2.2.26 → pycaption-2.2.28}/pycaption/srt.py +0 -0
  32. {pycaption-2.2.26 → pycaption-2.2.28}/pycaption/transcript.py +0 -0
  33. {pycaption-2.2.26 → pycaption-2.2.28}/pycaption/utils.py +0 -0
  34. {pycaption-2.2.26 → pycaption-2.2.28}/pycaption.egg-info/SOURCES.txt +0 -0
  35. {pycaption-2.2.26 → pycaption-2.2.28}/pycaption.egg-info/dependency_links.txt +0 -0
  36. {pycaption-2.2.26 → pycaption-2.2.28}/pycaption.egg-info/requires.txt +0 -0
  37. {pycaption-2.2.26 → pycaption-2.2.28}/pycaption.egg-info/top_level.txt +0 -0
  38. {pycaption-2.2.26 → pycaption-2.2.28}/setup.cfg +0 -0
  39. {pycaption-2.2.26 → pycaption-2.2.28}/tests/__init__.py +0 -0
  40. {pycaption-2.2.26 → pycaption-2.2.28}/tests/fixtures/__init__.py +0 -0
  41. {pycaption-2.2.26 → pycaption-2.2.28}/tests/fixtures/dfxp.py +0 -0
  42. {pycaption-2.2.26 → pycaption-2.2.28}/tests/fixtures/microdvd.py +0 -0
  43. {pycaption-2.2.26 → pycaption-2.2.28}/tests/fixtures/sami.py +0 -0
  44. {pycaption-2.2.26 → pycaption-2.2.28}/tests/fixtures/scc.py +0 -0
  45. {pycaption-2.2.26 → pycaption-2.2.28}/tests/fixtures/srt.py +0 -0
  46. {pycaption-2.2.26 → pycaption-2.2.28}/tests/fixtures/translated_scc.py +0 -0
  47. {pycaption-2.2.26 → pycaption-2.2.28}/tests/mixins.py +0 -0
  48. {pycaption-2.2.26 → pycaption-2.2.28}/tests/test_base.py +0 -0
  49. {pycaption-2.2.26 → pycaption-2.2.28}/tests/test_dfxp_conversion.py +0 -0
  50. {pycaption-2.2.26 → pycaption-2.2.28}/tests/test_dfxp_extras.py +0 -0
  51. {pycaption-2.2.26 → pycaption-2.2.28}/tests/test_functions.py +0 -0
  52. {pycaption-2.2.26 → pycaption-2.2.28}/tests/test_geometry.py +0 -0
  53. {pycaption-2.2.26 → pycaption-2.2.28}/tests/test_microdvd.py +0 -0
  54. {pycaption-2.2.26 → pycaption-2.2.28}/tests/test_microdvd_conversion.py +0 -0
  55. {pycaption-2.2.26 → pycaption-2.2.28}/tests/test_sami.py +0 -0
  56. {pycaption-2.2.26 → pycaption-2.2.28}/tests/test_sami_conversion.py +0 -0
  57. {pycaption-2.2.26 → pycaption-2.2.28}/tests/test_scc_conversion.py +0 -0
  58. {pycaption-2.2.26 → pycaption-2.2.28}/tests/test_scc_translator.py +0 -0
  59. {pycaption-2.2.26 → pycaption-2.2.28}/tests/test_scc_writer.py +0 -0
  60. {pycaption-2.2.26 → pycaption-2.2.28}/tests/test_srt.py +0 -0
  61. {pycaption-2.2.26 → pycaption-2.2.28}/tests/test_srt_conversion.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pycaption
3
- Version: 2.2.26
3
+ Version: 2.2.28
4
4
  Summary: Closed caption converter
5
5
  Author: Joe Norton
6
6
  Author-email: joey@nortoncrew.com
@@ -379,7 +379,7 @@ class DFXPWriter(BaseWriter):
379
379
 
380
380
  # Create the styles in the <styling> section, or a default style.
381
381
  for style_id, style in caption_set.get_styles():
382
- if style != {}:
382
+ if style != {} and not style_id.startswith("::"):
383
383
  dfxp = self._recreate_styling_tag(style_id, style, dfxp)
384
384
  if not caption_set.get_styles():
385
385
  dfxp = self._recreate_styling_tag(
@@ -54,6 +54,14 @@ class HorizontalAlignmentEnum(Enum):
54
54
  END = "end"
55
55
 
56
56
 
57
+ class WritingDirectionEnum(Enum):
58
+ """Specifies WebVTT writing direction (vertical cue setting)."""
59
+
60
+ HORIZONTAL = ""
61
+ VERTICAL_RL = "rl"
62
+ VERTICAL_LR = "lr"
63
+
64
+
57
65
  class Alignment:
58
66
  def __init__(self, horizontal, vertical):
59
67
  """
@@ -709,6 +717,7 @@ class Layout:
709
717
  padding=None,
710
718
  alignment=None,
711
719
  webvtt_positioning=None,
720
+ writing_direction=None,
712
721
  inherit_from=None,
713
722
  ):
714
723
  """
@@ -729,8 +738,10 @@ class Layout:
729
738
  :type webvtt_positioning: str
730
739
  :param webvtt_positioning: A string with the raw WebVTT cue settings.
731
740
  This is used so that WebVTT positioning isn't lost on conversion
732
- from WebVTT to WebVTT. It is needed only because pycaption
733
- currently doesn't support reading positioning from WebVTT.
741
+ from WebVTT to WebVTT.
742
+
743
+ :type writing_direction: WritingDirectionEnum
744
+ :param writing_direction: WebVTT vertical writing direction (rl or lr).
734
745
 
735
746
  :type inherit_from: Layout
736
747
  :param inherit_from: A Layout with the positioning parameters to be
@@ -742,9 +753,13 @@ class Layout:
742
753
  self.padding = padding
743
754
  self.alignment = alignment
744
755
  self.webvtt_positioning = webvtt_positioning
756
+ self.writing_direction = writing_direction
745
757
 
746
758
  if inherit_from:
747
- for attr_name in ["origin", "extent", "padding", "alignment"]:
759
+ for attr_name in [
760
+ "origin", "extent", "padding", "alignment",
761
+ "writing_direction",
762
+ ]:
748
763
  attr = getattr(self, attr_name)
749
764
  if not attr:
750
765
  setattr(self, attr_name, getattr(inherit_from, attr_name))
@@ -757,6 +772,7 @@ class Layout:
757
772
  self.padding,
758
773
  self.alignment,
759
774
  self.webvtt_positioning,
775
+ self.writing_direction,
760
776
  ]
761
777
  )
762
778
 
@@ -773,6 +789,7 @@ class Layout:
773
789
  None if not self.extent else self.extent.serialized(),
774
790
  None if not self.padding else self.padding.serialized(),
775
791
  None if not self.alignment else self.alignment.serialized(),
792
+ self.writing_direction,
776
793
  )
777
794
 
778
795
  def __eq__(self, other):
@@ -782,6 +799,7 @@ class Layout:
782
799
  and self.extent == other.extent
783
800
  and self.padding == other.padding
784
801
  and self.alignment == other.alignment
802
+ and self.writing_direction == other.writing_direction
785
803
  )
786
804
 
787
805
  def __ne__(self, other):
@@ -793,6 +811,7 @@ class Layout:
793
811
  + hash(self.extent) * 11
794
812
  + hash(self.padding) * 13
795
813
  + hash(self.alignment) * 5
814
+ + hash(self.writing_direction) * 19
796
815
  + 17
797
816
  )
798
817
 
@@ -520,7 +520,7 @@ class SAMIWriter(BaseWriter):
520
520
  stylesheet = "<!--"
521
521
 
522
522
  for attr, value in caption_set.get_styles():
523
- if value != {}:
523
+ if value != {} and not attr.startswith("::"):
524
524
  stylesheet += self._recreate_style_block(
525
525
  attr, value, caption_set.layout_info
526
526
  )