_Application.py
Go to the documentation of this file.
00001 """autogenerated by genpy from launchman/Application.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006 
00007 
00008 class Application(genpy.Message):
00009   _md5sum = "f6a16a9c297a883b8eb15bf869d26eca"
00010   _type = "launchman/Application"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """string taskid
00013 string name
00014 string status
00015 string icon
00016 string provides
00017 string depends
00018 
00019 """
00020   __slots__ = ['taskid','name','status','icon','provides','depends']
00021   _slot_types = ['string','string','string','string','string','string']
00022 
00023   def __init__(self, *args, **kwds):
00024     """
00025     Constructor. Any message fields that are implicitly/explicitly
00026     set to None will be assigned a default value. The recommend
00027     use is keyword arguments as this is more robust to future message
00028     changes.  You cannot mix in-order arguments and keyword arguments.
00029 
00030     The available fields are:
00031        taskid,name,status,icon,provides,depends
00032 
00033     :param args: complete set of field values, in .msg order
00034     :param kwds: use keyword arguments corresponding to message field names
00035     to set specific fields.
00036     """
00037     if args or kwds:
00038       super(Application, self).__init__(*args, **kwds)
00039       #message fields cannot be None, assign default values for those that are
00040       if self.taskid is None:
00041         self.taskid = ''
00042       if self.name is None:
00043         self.name = ''
00044       if self.status is None:
00045         self.status = ''
00046       if self.icon is None:
00047         self.icon = ''
00048       if self.provides is None:
00049         self.provides = ''
00050       if self.depends is None:
00051         self.depends = ''
00052     else:
00053       self.taskid = ''
00054       self.name = ''
00055       self.status = ''
00056       self.icon = ''
00057       self.provides = ''
00058       self.depends = ''
00059 
00060   def _get_types(self):
00061     """
00062     internal API method
00063     """
00064     return self._slot_types
00065 
00066   def serialize(self, buff):
00067     """
00068     serialize message into buffer
00069     :param buff: buffer, ``StringIO``
00070     """
00071     try:
00072       _x = self.taskid
00073       length = len(_x)
00074       if python3 or type(_x) == unicode:
00075         _x = _x.encode('utf-8')
00076         length = len(_x)
00077       buff.write(struct.pack('<I%ss'%length, length, _x))
00078       _x = self.name
00079       length = len(_x)
00080       if python3 or type(_x) == unicode:
00081         _x = _x.encode('utf-8')
00082         length = len(_x)
00083       buff.write(struct.pack('<I%ss'%length, length, _x))
00084       _x = self.status
00085       length = len(_x)
00086       if python3 or type(_x) == unicode:
00087         _x = _x.encode('utf-8')
00088         length = len(_x)
00089       buff.write(struct.pack('<I%ss'%length, length, _x))
00090       _x = self.icon
00091       length = len(_x)
00092       if python3 or type(_x) == unicode:
00093         _x = _x.encode('utf-8')
00094         length = len(_x)
00095       buff.write(struct.pack('<I%ss'%length, length, _x))
00096       _x = self.provides
00097       length = len(_x)
00098       if python3 or type(_x) == unicode:
00099         _x = _x.encode('utf-8')
00100         length = len(_x)
00101       buff.write(struct.pack('<I%ss'%length, length, _x))
00102       _x = self.depends
00103       length = len(_x)
00104       if python3 or type(_x) == unicode:
00105         _x = _x.encode('utf-8')
00106         length = len(_x)
00107       buff.write(struct.pack('<I%ss'%length, length, _x))
00108     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00109     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00110 
00111   def deserialize(self, str):
00112     """
00113     unpack serialized message in str into this message instance
00114     :param str: byte array of serialized message, ``str``
00115     """
00116     try:
00117       end = 0
00118       start = end
00119       end += 4
00120       (length,) = _struct_I.unpack(str[start:end])
00121       start = end
00122       end += length
00123       if python3:
00124         self.taskid = str[start:end].decode('utf-8')
00125       else:
00126         self.taskid = str[start:end]
00127       start = end
00128       end += 4
00129       (length,) = _struct_I.unpack(str[start:end])
00130       start = end
00131       end += length
00132       if python3:
00133         self.name = str[start:end].decode('utf-8')
00134       else:
00135         self.name = str[start:end]
00136       start = end
00137       end += 4
00138       (length,) = _struct_I.unpack(str[start:end])
00139       start = end
00140       end += length
00141       if python3:
00142         self.status = str[start:end].decode('utf-8')
00143       else:
00144         self.status = str[start:end]
00145       start = end
00146       end += 4
00147       (length,) = _struct_I.unpack(str[start:end])
00148       start = end
00149       end += length
00150       if python3:
00151         self.icon = str[start:end].decode('utf-8')
00152       else:
00153         self.icon = str[start:end]
00154       start = end
00155       end += 4
00156       (length,) = _struct_I.unpack(str[start:end])
00157       start = end
00158       end += length
00159       if python3:
00160         self.provides = str[start:end].decode('utf-8')
00161       else:
00162         self.provides = str[start:end]
00163       start = end
00164       end += 4
00165       (length,) = _struct_I.unpack(str[start:end])
00166       start = end
00167       end += length
00168       if python3:
00169         self.depends = str[start:end].decode('utf-8')
00170       else:
00171         self.depends = str[start:end]
00172       return self
00173     except struct.error as e:
00174       raise genpy.DeserializationError(e) #most likely buffer underfill
00175 
00176 
00177   def serialize_numpy(self, buff, numpy):
00178     """
00179     serialize message with numpy array types into buffer
00180     :param buff: buffer, ``StringIO``
00181     :param numpy: numpy python module
00182     """
00183     try:
00184       _x = self.taskid
00185       length = len(_x)
00186       if python3 or type(_x) == unicode:
00187         _x = _x.encode('utf-8')
00188         length = len(_x)
00189       buff.write(struct.pack('<I%ss'%length, length, _x))
00190       _x = self.name
00191       length = len(_x)
00192       if python3 or type(_x) == unicode:
00193         _x = _x.encode('utf-8')
00194         length = len(_x)
00195       buff.write(struct.pack('<I%ss'%length, length, _x))
00196       _x = self.status
00197       length = len(_x)
00198       if python3 or type(_x) == unicode:
00199         _x = _x.encode('utf-8')
00200         length = len(_x)
00201       buff.write(struct.pack('<I%ss'%length, length, _x))
00202       _x = self.icon
00203       length = len(_x)
00204       if python3 or type(_x) == unicode:
00205         _x = _x.encode('utf-8')
00206         length = len(_x)
00207       buff.write(struct.pack('<I%ss'%length, length, _x))
00208       _x = self.provides
00209       length = len(_x)
00210       if python3 or type(_x) == unicode:
00211         _x = _x.encode('utf-8')
00212         length = len(_x)
00213       buff.write(struct.pack('<I%ss'%length, length, _x))
00214       _x = self.depends
00215       length = len(_x)
00216       if python3 or type(_x) == unicode:
00217         _x = _x.encode('utf-8')
00218         length = len(_x)
00219       buff.write(struct.pack('<I%ss'%length, length, _x))
00220     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00221     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00222 
00223   def deserialize_numpy(self, str, numpy):
00224     """
00225     unpack serialized message in str into this message instance using numpy for array types
00226     :param str: byte array of serialized message, ``str``
00227     :param numpy: numpy python module
00228     """
00229     try:
00230       end = 0
00231       start = end
00232       end += 4
00233       (length,) = _struct_I.unpack(str[start:end])
00234       start = end
00235       end += length
00236       if python3:
00237         self.taskid = str[start:end].decode('utf-8')
00238       else:
00239         self.taskid = str[start:end]
00240       start = end
00241       end += 4
00242       (length,) = _struct_I.unpack(str[start:end])
00243       start = end
00244       end += length
00245       if python3:
00246         self.name = str[start:end].decode('utf-8')
00247       else:
00248         self.name = str[start:end]
00249       start = end
00250       end += 4
00251       (length,) = _struct_I.unpack(str[start:end])
00252       start = end
00253       end += length
00254       if python3:
00255         self.status = str[start:end].decode('utf-8')
00256       else:
00257         self.status = str[start:end]
00258       start = end
00259       end += 4
00260       (length,) = _struct_I.unpack(str[start:end])
00261       start = end
00262       end += length
00263       if python3:
00264         self.icon = str[start:end].decode('utf-8')
00265       else:
00266         self.icon = str[start:end]
00267       start = end
00268       end += 4
00269       (length,) = _struct_I.unpack(str[start:end])
00270       start = end
00271       end += length
00272       if python3:
00273         self.provides = str[start:end].decode('utf-8')
00274       else:
00275         self.provides = str[start:end]
00276       start = end
00277       end += 4
00278       (length,) = _struct_I.unpack(str[start:end])
00279       start = end
00280       end += length
00281       if python3:
00282         self.depends = str[start:end].decode('utf-8')
00283       else:
00284         self.depends = str[start:end]
00285       return self
00286     except struct.error as e:
00287       raise genpy.DeserializationError(e) #most likely buffer underfill
00288 
00289 _struct_I = genpy.struct_I


launchman
Author(s): Scott Hassan
autogenerated on Wed Apr 23 2014 10:35:46