Skip to content

Commit

Permalink
2023 spec updates
Browse files Browse the repository at this point in the history
  • Loading branch information
futzu authored Jan 9, 2024
1 parent 7fdec7e commit d0c3d9f
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions threefive/descriptors.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -58,13 +58,19 @@ 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):
"""
SpliceDescriptor.encode
"""
nbin = self._chk_nbin(nbin)
self._encode_id(nbin)
nbin.add_bites(self.private_data)
return nbin

def _encode_id(self, nbin):
Expand Down Expand Up @@ -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

0 comments on commit d0c3d9f

Please sign in to comment.