scripts: Adopted rbydaddr/tagrepr changes across scripts

Just some minor tweaks:

- rbydaddr: Return list instead of tuple, note we rely on the type
  distinction in Rbyd.fetch now.

- tagrepr: Rename w -> weight.
This commit is contained in:
Christopher Haster
2025-03-18 12:49:32 -05:00
parent 21049321a5
commit 73127470f9
9 changed files with 88 additions and 90 deletions
+5 -5
View File
@@ -32,10 +32,10 @@ def bdgeom(s):
return int(s, b)
# parse some rbyd addr encodings
# 0xa -> (0xa,)
# 0xa.c -> ((0xa, 0xc),)
# 0x{a,b} -> (0xa, 0xb)
# 0x{a,b}.c -> ((0xa, 0xc), (0xb, 0xc))
# 0xa -> [0xa]
# 0xa.c -> [(0xa, 0xc)]
# 0x{a,b} -> [0xa, 0xb]
# 0x{a,b}.c -> [(0xa, 0xc), (0xb, 0xc)]
def rbydaddr(s):
s = s.strip()
b = 10
@@ -66,7 +66,7 @@ def rbydaddr(s):
else:
addr.append(int(s, b))
return tuple(addr)
return addr
def xxd(data, width=16):
for i in range(0, len(data), width):