partition_table: Fix pylint issues in gen_esp32part.py

This commit is contained in:
Angus Gratton
2021-04-12 17:16:49 +10:00
parent 6f6b4c3983
commit b45b817e6f

View File

@@ -115,15 +115,15 @@ class PartitionTable(list):
@classmethod @classmethod
def from_file(cls, f): def from_file(cls, f):
input = f.read() data = f.read()
input_is_binary = input[0:2] == PartitionDefinition.MAGIC_BYTES data_is_binary = data[0:2] == PartitionDefinition.MAGIC_BYTES
if input_is_binary: if data_is_binary:
status('Parsing binary partition input...') status('Parsing binary partition input...')
return cls.from_binary(input), True return cls.from_binary(data), True
else:
input = input.decode() data = data.decode()
status('Parsing CSV input...') status('Parsing CSV input...')
return cls.from_csv(input), False return cls.from_csv(data), False
@classmethod @classmethod
def from_csv(cls, csv_contents): def from_csv(cls, csv_contents):
@@ -186,7 +186,7 @@ class PartitionTable(list):
None if not found """ None if not found """
# convert ptype & subtypes names (if supplied this way) to integer values # convert ptype & subtypes names (if supplied this way) to integer values
ptype = get_ptype_as_int(ptype) ptype = get_ptype_as_int(ptype)
subtype = get_subtype_as_int(subtype) subtype = get_subtype_as_int(ptype, subtype)
for p in self: for p in self:
if p.type == ptype and p.subtype == subtype: if p.type == ptype and p.subtype == subtype: