self.packer = BaseTypes(field_type, num)
self.size = self.packer.size
- def pack(self, list, kwargs = None):
+ def pack(self, list, kwargs=None):
"""Packs a fixed length bytestring. Left-pads with zeros
if input data is too short."""
if not list:
if 'length' in msgdef:
if msgdef['length'] == 0:
raise ValueError()
- types[name] = FixedList(name, msgdef['type'], msgdef['length'])
+ if msgdef['type'] == 'u8':
+ types[name] = FixedList_u8(name, msgdef['type'],
+ msgdef['length'])
+ else:
+ types[name] = FixedList(name, msgdef['type'], msgdef['length'])
else:
types[name] = t