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


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