Skip to content

Commit

Permalink
massive update on SegmentationDescriptor.from_xml()
Browse files Browse the repository at this point in the history
  • Loading branch information
futzu authored Nov 26, 2024
1 parent 383fc0e commit 282303f
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions threefive/descriptors.py
Original file line number Diff line number Diff line change
Expand Up @@ -560,18 +560,20 @@ def from_xml(self, stuff):
"""
Load a SegmentationDescriptor from XML
"""
self.load(stuff["SegmentationDescriptor"])
ssd = stuff["SegmentationDescriptor"]
self.load(ssd)
self.segmentation_event_id_compliance_indicator = True
self.program_segmentation_flag = True
self.segmentation_duration_flag = False
if "segmentationDuration" in stuff["SegmentationDescriptor"]:
if "segmentationDuration" in ssd:
self.segmentation_duration_flag = True
self.delivery_not_restricted_flag = True
if "DeliveryRestrictions" in stuff:
sdr = stuff["DeliveryRestrictions"]
self.delivery_not_restricted_flag = False
self.load(stuff["DeliveryRestrictions"])
self.device_restrictions = table20[self.device_restrictions]
self.segmentation_event_id = hex(self.segmentation_event_id)
self.load(sdr)
self.device_restrictions = table20[sdr["device_restrictions"]]
self.segmentation_event_id = hex(ssd["segmentation_event_id"])
if self.segmentation_type_id in table22:
self.segmentation_message = table22[self.segmentation_type_id]
self._upid_from_xml(stuff)
Expand Down

0 comments on commit 282303f

Please sign in to comment.