Skip to content

Commit

Permalink
Update xml_generate.py
Browse files Browse the repository at this point in the history
more linting fixes
  • Loading branch information
pwittich committed Feb 5, 2024
1 parent 8014bd9 commit 98aa1d9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/xml_generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
zm_num_entries = 1024

#% %
def make_node(parent: ET.Element, myid: str, thedict: dict, addr2: int, bit: int,
def make_node(parent: ET.Element, myid: str, thedict: dict, addr2: int, i_bit: int,
parent_id: str) -> ET.Element:
"""create the node to be inserted into the xml tree"""
# pylint: disable=too-many-branches
Expand All @@ -19,7 +19,7 @@ def make_node(parent: ET.Element, myid: str, thedict: dict, addr2: int, bit: int
thenode.set('id', myid)
#address is half of the sensor address since these are 32 bit addresses
theaddr = int(addr2/2)
remain = bit
remain = i_bit
thenode.set('address', str(hex(theaddr)))
#this appears to be on all the nodes
thenode.set("permission", "r")
Expand Down Expand Up @@ -92,12 +92,12 @@ def calc_size(thedict: dict) -> int:
#and a pretty print method
class reg:
"""create an object with a name, and a start end end register"""
def __init__(self, name, sta, end, sz, width):
def __init__(self, name, sta, end, sz, ww):
self.name = name
self.start = sta
self.end = end
self.size = sz
self.width = width
self.width = ww

def __str__(self):
return "name: " + self.name + " start: " + str(self.start) + \
Expand Down Expand Up @@ -194,7 +194,7 @@ def yaml_file(filename):
pp.set('address', str(hex(addr)))
node = make_node(pp, p, c, j, bit, n)
else: # any non-first byte in a name node
if (prev_bit == 0): #the upper byte of the previous postfix node
if prev_bit == 0: #the upper byte of the previous postfix node
node = make_node(pp, p, c, j, bit, n)
else : #the low byte with an increasing postfix node by one
node = make_node(pp, p, c, j+1, bit, n)
Expand Down

0 comments on commit 98aa1d9

Please sign in to comment.