haddaway 2012-10-20 20:25:43 -07:00
commit 243a948aa5
1 changed files with 29 additions and 1 deletions

View File

@ -40,4 +40,32 @@ class ToorChatMessage():
return self.start + self.xid + self.user + self.data + self.end
def to_string(self):
return self.__str__()
return self.__str__()
class ToorChatParsePacket():
''' This is a class for parsing the data of the packet '''
def __init__(self):
self.start = ToorChatProtocol.get_packet_start
self.end = ToorChatProtocol.get_packet_end
def check_packet_start(self, message):
if message.start == self.start
return True
else
return False
def check_packet_end(self, message):
if message.end == self.end
return True
else
return False
def get_xid(cls):
return self.xid
def get_user(cls):
return self.user
def get_message(cls):
return self.message