From bef90b208277052605b181a8155d4ee6dc849585 Mon Sep 17 00:00:00 2001 From: Markus Birth Date: Thu, 25 Mar 2021 00:23:04 +0100 Subject: [PATCH] Write format codes into list instead of string. Fixes #12. --- grmn/tlv.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/grmn/tlv.py b/grmn/tlv.py index dbf2a10..e704c4d 100644 --- a/grmn/tlv.py +++ b/grmn/tlv.py @@ -232,13 +232,13 @@ class TLV6(TLV): def __init__(self, type_id: int, expected_length: int, value=None, offset: int=None): super().__init__(type_id, expected_length, value, offset) self.fids = [] - self.format = "" + self.format = [] self.fields = [] def add_fid(self, fid: int): fdef = self.FIELD_TYPES[fid] self.fids.append(fid) - self.format += fdef[0] + self.format.append(fdef[0]) self.fields.append(fdef[1]) def parse(self): @@ -249,7 +249,7 @@ class TLV6(TLV): raise Exception(RED + "Invalid TLV6 payload length!" + RESET) self.fids = [] - self.format = "" + self.format = [] self.fields = [] for i in range(0, len(self.value), 2): fid = unpack("