Skip to content

Commit

Permalink
synchronize leep with bedrock
Browse files Browse the repository at this point in the history
absorbs bedrock commits 4cad0164, c30e843b, and fda69d52.
Spelling, flake8 lint, and actual runtime bugs related to string handling
  • Loading branch information
ldoolitt committed Sep 4, 2024
1 parent ad49824 commit 5ba681c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/python/leep/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,9 @@ def expand_regname(self, name, instance=[]):
# build a regexp
# from a list of name fragments
fragments = self.instance + instance + [name]
# match when consecutive fragments are seperated by
# match when consecutive fragments are separated by
# 1. a single '_'. ['A', 'B'] matches 'A_B'.
# 2. two '_' with anything inbetween. 'A_blah_B' or 'A_x_y_z_B'.
# 2. two '_' with anything in between. 'A_blah_B' or 'A_x_y_z_B'.
regx = r'_(?:.*_)?'.join([re.escape(str(i)) for i in fragments])
R = re.compile('^.*%s$' % regx)

Expand Down Expand Up @@ -200,7 +200,7 @@ def wait_for_acq(self, tag=False, timeout=5.0, instance=[]):
;param bool tag: Whether to use the tag mechanism to wait for a update
:param float timeout: How long to wait for an acquisition.
Seperate from the communications timeout.
Separate from the communications timeout.
:param list instance: List of instance identifiers.
"""
raise NotImplementedError
Expand Down
4 changes: 2 additions & 2 deletions src/python/leep/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def dumpgitid(args, dev):


def dumpdescript(args, dev):
print(dev.descript.decode())
print(dev.descript)


def dumpdrv(args, dev):
Expand Down Expand Up @@ -175,7 +175,7 @@ def gentemplate(args, dev):
# Code: %s
# Name Mode: -M %s
''' % (dev.descript.decode(), dev.jsonhash, dev.codehash, args.mode))
''' % (dev.descript, dev.jsonhash, dev.codehash, args.mode))

out.write('file "feed_base.template"\n{\n{PREF="$(CHAS):CTRL_"}\n}\n\n')

Expand Down
2 changes: 1 addition & 1 deletion src/python/leep/eng/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def main(args):

with open(args.output, 'wb') as F:
F.write(b'<?xml version="1.0" encoding="UTF-8"?>\n')
F.write(ET.tobytes(T))
F.write(ET.tostring(T))


if __name__ == '__main__':
Expand Down
6 changes: 3 additions & 3 deletions src/python/leep/raw.py
Original file line number Diff line number Diff line change
Expand Up @@ -513,8 +513,8 @@ def _trysize(self, start_addr):
values_preamble = numpy.array(values)
self._checkrom(values, True)
if self.size_rom != 0:
total_rom_size = (self.hash_descriptor_size
+ self.size_desc + self.size_rom)
total_rom_size = (self.hash_descriptor_size +
self.size_desc + self.size_rom)
stop_addr = end_addr + total_rom_size - self.preamble_max_size
values_json = self.exchange(range(end_addr, stop_addr))
preamble_json = numpy.concatenate((values_preamble, values_json))
Expand Down Expand Up @@ -551,7 +551,7 @@ def _checkrom(self, values, preamble_check=False):
raise RomError("Truncated ROM Descriptor")

if type == 1:
blob = blob.tobytes()
blob = blob.tobytes().decode()
self.size_desc = size
if self.descript is None:
self.descript = blob
Expand Down

0 comments on commit 5ba681c

Please sign in to comment.