class for network messages

portnov [2009-02-24 20:03:21]
class for network messages
Filename
data.py
diff --git a/data.py b/data.py
index 66c45ae..f0d3d0a 100644
--- a/data.py
+++ b/data.py
@@ -18,4 +18,10 @@ class Service(object):
     def __repr__(self):
         return "<Service %s on %s:%s>" % (self.name,self.ip,self.port)

-
+class Message(object):
+    def __init__(self,type,**kwargs):
+        self.type = type
+        self.__dict__.update(kwargs)
+
+    def __repr__(self):
+        return "<Message of type %s>" % self.type
ViewGit