fancy tlv fixes

git-svn-id: svn+ssh://localhost/home/henryk/svn/cyberflex-shell/trunk@60 f711b948-2313-0410-aaa9-d29f33439f0b
This commit is contained in:
hploetz 2006-05-19 18:28:35 +00:00
parent 60c80e35c7
commit 81dc0e7eb9
1 changed files with 2 additions and 2 deletions

View File

@ -12,7 +12,7 @@ def represent_binary_fancy(len, value, mask = 0):
else:
result.append( "." )
mask = mask >> 1
value = value >> 2
value = value >> 1
result.reverse()
return "".join(result).strip()
@ -24,7 +24,7 @@ def parse_binary(value, bytemasks, verbose = False, value_len = 8):
for mask, byte, nonmatch, match in bytemasks:
if verbose:
prefix = represent_binary_fancy(value_len, byte, mask) + ": "
prefix = represent_binary_fancy(value_len, value, mask) + ": "
else:
prefix = ""
if (value & mask) == (byte & mask):