all tests pass

This commit is contained in:
locklainn.linden
2008-08-08 14:18:47 +00:00
committed by Salad Dais
parent 42fcd8f8ea
commit e39b341f18
3 changed files with 13 additions and 11 deletions

View File

@@ -131,11 +131,14 @@ class MessageTemplateBuilder(object):
if variable.type == MsgType.MVT_VARIABLE:
data_size = template_block.get_variable(variable.name).size
if data_size == 1:
block_buffer += struct.pack('>B', var_size)
block_buffer += self.packer.pack_data(var_size, MsgType.MVT_U8)
#block_buffer += struct.pack('>B', var_size)
elif data_size == 2:
block_buffer += struct.pack('>H', var_size)
block_buffer += self.packer.pack_data(var_size, MsgType.MVT_U16)
#block_buffer += struct.pack('>H', var_size)
elif data_size == 4:
block_buffer += struct.pack('>I', var_size)
block_buffer += self.packer.pack_data(var_size, MsgType.MVT_U32)
#block_buffer += struct.pack('>I', var_size)
else:
raise Exception('Attempting to build variable with unknown size \
of ' + str(var_size))