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:
+5
-5
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user