From d0c3d9f00959b48f2de43150c6e8c66df31e61ee Mon Sep 17 00:00:00 2001 From: Adrian <52701496+futzu@users.noreply.github.com> Date: Mon, 8 Jan 2024 23:44:21 -0500 Subject: [PATCH] 2023 spec updates --- threefive/descriptors.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/threefive/descriptors.py b/threefive/descriptors.py index df5a64aa..e91c9411 100644 --- a/threefive/descriptors.py +++ b/threefive/descriptors.py @@ -28,7 +28,7 @@ def __init__(self, bites=None): self.tag = None self.descriptor_length = 0 self.name = None - self.identifier = "CUEI" + self.identifier =None self.bites = bites self.parse_tag_and_len() self.parse_id() @@ -58,6 +58,11 @@ def parse_id(self): # raise Exception('Identifier Is Not "CUEI"') self.bites = self.bites[4:] + def decode(self): + """ + decode handles Private Descriptors + """ + self.private_data = self.bites def encode(self, nbin=None): """ @@ -65,6 +70,7 @@ def encode(self, nbin=None): """ nbin = self._chk_nbin(nbin) self._encode_id(nbin) + nbin.add_bites(self.private_data) return nbin def _encode_id(self, nbin): @@ -418,8 +424,6 @@ def splice_descriptor(bites): replaced splice_descriptor """ tag = bites[0] - if tag not in descriptor_map: - return SpliceDescriptor(bites) - spliced = descriptor_map[tag](bites) + spliced = ( SpliceDescriptor(bites),descriptor_map[tag](bites))[tag in descriptor_map] spliced.decode() return spliced