From 586bd74fda1dbde18c2d7e3eb7f1ca6b0bd32756 Mon Sep 17 00:00:00 2001 From: "tao.takashi" Date: Wed, 3 Sep 2008 23:09:24 +0000 Subject: [PATCH] some cleanups and removed a dummy method. --- pyogp/lib/base/message/udpserializer.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/pyogp/lib/base/message/udpserializer.py b/pyogp/lib/base/message/udpserializer.py index dd7c33f..6d9500c 100644 --- a/pyogp/lib/base/message/udpserializer.py +++ b/pyogp/lib/base/message/udpserializer.py @@ -13,25 +13,24 @@ from data_packer import DataPacker from pyogp.lib.base.interfaces import ISerialization class UDPPacketSerializer(grok.Adapter): - grok.implements(ISerialization) - grok.context(IUDPPacket) + """ an adpater for serializing a IUDPPacket into the UDP message format - """ This class builds messages at its high level, that is, keeping + This class builds messages at its high level, that is, keeping that data in data structure form. A serializer should be used on the message produced by this so that it can be sent over a network. """ + + grok.implements(ISerialization) + grok.context(IUDPPacket) + def __init__(self, context): - #when a message is being built, uses this template - #to add blocks and variables - self.context = context + """initialize the adapter""" + self.context = context # the UDPPacket template_dict = getUtility(ITemplateDictionary) self.current_template = template_dict.get_template(context.name) self.packer = DataPacker() def serialize(self): - return self.build_message() - - def build_message(self): """ Builds the message by serializing the data. Creates a packet ready to be sent. """