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
@@ -97,10 +97,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
|
||||
@@ -131,7 +131,7 @@ def rbydaddr(s):
|
||||
else:
|
||||
addr.append(int(s, b))
|
||||
|
||||
return tuple(addr)
|
||||
return addr
|
||||
|
||||
def crc32c(data, crc=0):
|
||||
crc ^= 0xffffffff
|
||||
|
||||
Reference in New Issue
Block a user