No, really

This commit is contained in:
Neale Pickett 2008-07-14 16:27:45 -06:00
parent 6c2ee3b993
commit 297598b7de
3 changed files with 7 additions and 2 deletions

View File

@ -200,6 +200,12 @@ def bin(i, bits=None):
return BitVector(i, bits).bitstr() return BitVector(i, bits).bitstr()
def unhex(s):
"""Decode a string as hex, stripping whitespace first"""
return [ord(i) for i in s.replace(' ', '').decode('hex')]
## ##
## Codecs ## Codecs
## ##

View File

@ -17,7 +17,6 @@ class GapString:
self.length = 0 self.length = 0
self.drop = drop self.drop = drop
if init: if init:
print init
self.append(init) self.append(init)
def __len__(self): def __len__(self):

2
ip.py
View File

@ -494,7 +494,7 @@ class Session:
saddr = chunk.first.saddr saddr = chunk.first.saddr
try: try:
(first, data) = self.pending[saddr] (first, data) = self.pending.pop(saddr)
except KeyError: except KeyError:
first = chunk.first first = chunk.first
data = gapstr.GapString() data = gapstr.GapString()