$search
00001 """autogenerated by genmsg_py from WebEvent.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 00006 class WebEvent(roslib.message.Message): 00007 _md5sum = "4f05e2e1608bf7d788fa5e654f805aeb" 00008 _type = "web_msgs/WebEvent" 00009 _has_header = False #flag to mark the presence of a Header object 00010 _full_text = """string source # who or what triggered the event 00011 string type # type of event (e.g. login, logout) 00012 string data # any data about the event 00013 """ 00014 __slots__ = ['source','type','data'] 00015 _slot_types = ['string','string','string'] 00016 00017 def __init__(self, *args, **kwds): 00018 """ 00019 Constructor. Any message fields that are implicitly/explicitly 00020 set to None will be assigned a default value. The recommend 00021 use is keyword arguments as this is more robust to future message 00022 changes. You cannot mix in-order arguments and keyword arguments. 00023 00024 The available fields are: 00025 source,type,data 00026 00027 @param args: complete set of field values, in .msg order 00028 @param kwds: use keyword arguments corresponding to message field names 00029 to set specific fields. 00030 """ 00031 if args or kwds: 00032 super(WebEvent, self).__init__(*args, **kwds) 00033 #message fields cannot be None, assign default values for those that are 00034 if self.source is None: 00035 self.source = '' 00036 if self.type is None: 00037 self.type = '' 00038 if self.data is None: 00039 self.data = '' 00040 else: 00041 self.source = '' 00042 self.type = '' 00043 self.data = '' 00044 00045 def _get_types(self): 00046 """ 00047 internal API method 00048 """ 00049 return self._slot_types 00050 00051 def serialize(self, buff): 00052 """ 00053 serialize message into buffer 00054 @param buff: buffer 00055 @type buff: StringIO 00056 """ 00057 try: 00058 _x = self.source 00059 length = len(_x) 00060 buff.write(struct.pack('<I%ss'%length, length, _x)) 00061 _x = self.type 00062 length = len(_x) 00063 buff.write(struct.pack('<I%ss'%length, length, _x)) 00064 _x = self.data 00065 length = len(_x) 00066 buff.write(struct.pack('<I%ss'%length, length, _x)) 00067 except struct.error as se: self._check_types(se) 00068 except TypeError as te: self._check_types(te) 00069 00070 def deserialize(self, str): 00071 """ 00072 unpack serialized message in str into this message instance 00073 @param str: byte array of serialized message 00074 @type str: str 00075 """ 00076 try: 00077 end = 0 00078 start = end 00079 end += 4 00080 (length,) = _struct_I.unpack(str[start:end]) 00081 start = end 00082 end += length 00083 self.source = str[start:end] 00084 start = end 00085 end += 4 00086 (length,) = _struct_I.unpack(str[start:end]) 00087 start = end 00088 end += length 00089 self.type = str[start:end] 00090 start = end 00091 end += 4 00092 (length,) = _struct_I.unpack(str[start:end]) 00093 start = end 00094 end += length 00095 self.data = str[start:end] 00096 return self 00097 except struct.error as e: 00098 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00099 00100 00101 def serialize_numpy(self, buff, numpy): 00102 """ 00103 serialize message with numpy array types into buffer 00104 @param buff: buffer 00105 @type buff: StringIO 00106 @param numpy: numpy python module 00107 @type numpy module 00108 """ 00109 try: 00110 _x = self.source 00111 length = len(_x) 00112 buff.write(struct.pack('<I%ss'%length, length, _x)) 00113 _x = self.type 00114 length = len(_x) 00115 buff.write(struct.pack('<I%ss'%length, length, _x)) 00116 _x = self.data 00117 length = len(_x) 00118 buff.write(struct.pack('<I%ss'%length, length, _x)) 00119 except struct.error as se: self._check_types(se) 00120 except TypeError as te: self._check_types(te) 00121 00122 def deserialize_numpy(self, str, numpy): 00123 """ 00124 unpack serialized message in str into this message instance using numpy for array types 00125 @param str: byte array of serialized message 00126 @type str: str 00127 @param numpy: numpy python module 00128 @type numpy: module 00129 """ 00130 try: 00131 end = 0 00132 start = end 00133 end += 4 00134 (length,) = _struct_I.unpack(str[start:end]) 00135 start = end 00136 end += length 00137 self.source = str[start:end] 00138 start = end 00139 end += 4 00140 (length,) = _struct_I.unpack(str[start:end]) 00141 start = end 00142 end += length 00143 self.type = str[start:end] 00144 start = end 00145 end += 4 00146 (length,) = _struct_I.unpack(str[start:end]) 00147 start = end 00148 end += length 00149 self.data = str[start:end] 00150 return self 00151 except struct.error as e: 00152 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00153 00154 _struct_I = roslib.message.struct_I