Simplify example Python client
- Move handling packet size out of RandomFill - Adds an InitMessage function to vloed.py to set message header without using NewMessage - No more exceptions in normal program flow!
This commit is contained in:
parent
d15f225b66
commit
1499890862
2 changed files with 22 additions and 13 deletions
4
vloed.py
4
vloed.py
|
|
@ -264,6 +264,10 @@ class PixelVloedClient(object):
|
|||
def NewMessage():
|
||||
"""Creates a new message with the correct max size, rgb mode and version"""
|
||||
message = MaxSizeList(MAX_PIXELS+2)
|
||||
InitMessage(message)
|
||||
return message
|
||||
|
||||
def InitMessage(message):
|
||||
message.append(SetRGBAMode(False))
|
||||
message.append(SetVersionBit())
|
||||
return message
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue