_ExchangeApp.py
Go to the documentation of this file.
00001 """autogenerated by genpy from turtlebot_app_manager/ExchangeApp.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 turtlebot_app_manager.msg
00008 
00009 class ExchangeApp(genpy.Message):
00010   _md5sum = "ccad20aa9f390121e44c61d218038d78"
00011   _type = "turtlebot_app_manager/ExchangeApp"
00012   _has_header = False #flag to mark the presence of a Header object
00013   _full_text = """# app name
00014 string name
00015 # user-friendly display name of application
00016 string display_name
00017 # the version of the package currently installed
00018 string version
00019 # latest version of the package avaliable
00020 string latest_version
00021 # the detailed description of the app
00022 string description
00023 # icon for showing app
00024 Icon icon
00025 # hidden apps are not show - used for cases where multiple apps are in a deb
00026 bool hidden
00027 ================================================================================
00028 MSG: turtlebot_app_manager/Icon
00029 # Image data format.  "jpeg" or "png"
00030 string format
00031 
00032 # Image data.
00033 uint8[] data
00034 
00035 """
00036   __slots__ = ['name','display_name','version','latest_version','description','icon','hidden']
00037   _slot_types = ['string','string','string','string','string','turtlebot_app_manager/Icon','bool']
00038 
00039   def __init__(self, *args, **kwds):
00040     """
00041     Constructor. Any message fields that are implicitly/explicitly
00042     set to None will be assigned a default value. The recommend
00043     use is keyword arguments as this is more robust to future message
00044     changes.  You cannot mix in-order arguments and keyword arguments.
00045 
00046     The available fields are:
00047        name,display_name,version,latest_version,description,icon,hidden
00048 
00049     :param args: complete set of field values, in .msg order
00050     :param kwds: use keyword arguments corresponding to message field names
00051     to set specific fields.
00052     """
00053     if args or kwds:
00054       super(ExchangeApp, self).__init__(*args, **kwds)
00055       #message fields cannot be None, assign default values for those that are
00056       if self.name is None:
00057         self.name = ''
00058       if self.display_name is None:
00059         self.display_name = ''
00060       if self.version is None:
00061         self.version = ''
00062       if self.latest_version is None:
00063         self.latest_version = ''
00064       if self.description is None:
00065         self.description = ''
00066       if self.icon is None:
00067         self.icon = turtlebot_app_manager.msg.Icon()
00068       if self.hidden is None:
00069         self.hidden = False
00070     else:
00071       self.name = ''
00072       self.display_name = ''
00073       self.version = ''
00074       self.latest_version = ''
00075       self.description = ''
00076       self.icon = turtlebot_app_manager.msg.Icon()
00077       self.hidden = False
00078 
00079   def _get_types(self):
00080     """
00081     internal API method
00082     """
00083     return self._slot_types
00084 
00085   def serialize(self, buff):
00086     """
00087     serialize message into buffer
00088     :param buff: buffer, ``StringIO``
00089     """
00090     try:
00091       _x = self.name
00092       length = len(_x)
00093       if python3 or type(_x) == unicode:
00094         _x = _x.encode('utf-8')
00095         length = len(_x)
00096       buff.write(struct.pack('<I%ss'%length, length, _x))
00097       _x = self.display_name
00098       length = len(_x)
00099       if python3 or type(_x) == unicode:
00100         _x = _x.encode('utf-8')
00101         length = len(_x)
00102       buff.write(struct.pack('<I%ss'%length, length, _x))
00103       _x = self.version
00104       length = len(_x)
00105       if python3 or type(_x) == unicode:
00106         _x = _x.encode('utf-8')
00107         length = len(_x)
00108       buff.write(struct.pack('<I%ss'%length, length, _x))
00109       _x = self.latest_version
00110       length = len(_x)
00111       if python3 or type(_x) == unicode:
00112         _x = _x.encode('utf-8')
00113         length = len(_x)
00114       buff.write(struct.pack('<I%ss'%length, length, _x))
00115       _x = self.description
00116       length = len(_x)
00117       if python3 or type(_x) == unicode:
00118         _x = _x.encode('utf-8')
00119         length = len(_x)
00120       buff.write(struct.pack('<I%ss'%length, length, _x))
00121       _x = self.icon.format
00122       length = len(_x)
00123       if python3 or type(_x) == unicode:
00124         _x = _x.encode('utf-8')
00125         length = len(_x)
00126       buff.write(struct.pack('<I%ss'%length, length, _x))
00127       _x = self.icon.data
00128       length = len(_x)
00129       # - if encoded as a list instead, serialize as bytes instead of string
00130       if type(_x) in [list, tuple]:
00131         buff.write(struct.pack('<I%sB'%length, length, *_x))
00132       else:
00133         buff.write(struct.pack('<I%ss'%length, length, _x))
00134       buff.write(_struct_B.pack(self.hidden))
00135     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00136     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00137 
00138   def deserialize(self, str):
00139     """
00140     unpack serialized message in str into this message instance
00141     :param str: byte array of serialized message, ``str``
00142     """
00143     try:
00144       if self.icon is None:
00145         self.icon = turtlebot_app_manager.msg.Icon()
00146       end = 0
00147       start = end
00148       end += 4
00149       (length,) = _struct_I.unpack(str[start:end])
00150       start = end
00151       end += length
00152       if python3:
00153         self.name = str[start:end].decode('utf-8')
00154       else:
00155         self.name = str[start:end]
00156       start = end
00157       end += 4
00158       (length,) = _struct_I.unpack(str[start:end])
00159       start = end
00160       end += length
00161       if python3:
00162         self.display_name = str[start:end].decode('utf-8')
00163       else:
00164         self.display_name = str[start:end]
00165       start = end
00166       end += 4
00167       (length,) = _struct_I.unpack(str[start:end])
00168       start = end
00169       end += length
00170       if python3:
00171         self.version = str[start:end].decode('utf-8')
00172       else:
00173         self.version = str[start:end]
00174       start = end
00175       end += 4
00176       (length,) = _struct_I.unpack(str[start:end])
00177       start = end
00178       end += length
00179       if python3:
00180         self.latest_version = str[start:end].decode('utf-8')
00181       else:
00182         self.latest_version = str[start:end]
00183       start = end
00184       end += 4
00185       (length,) = _struct_I.unpack(str[start:end])
00186       start = end
00187       end += length
00188       if python3:
00189         self.description = str[start:end].decode('utf-8')
00190       else:
00191         self.description = str[start:end]
00192       start = end
00193       end += 4
00194       (length,) = _struct_I.unpack(str[start:end])
00195       start = end
00196       end += length
00197       if python3:
00198         self.icon.format = str[start:end].decode('utf-8')
00199       else:
00200         self.icon.format = str[start:end]
00201       start = end
00202       end += 4
00203       (length,) = _struct_I.unpack(str[start:end])
00204       start = end
00205       end += length
00206       self.icon.data = str[start:end]
00207       start = end
00208       end += 1
00209       (self.hidden,) = _struct_B.unpack(str[start:end])
00210       self.hidden = bool(self.hidden)
00211       return self
00212     except struct.error as e:
00213       raise genpy.DeserializationError(e) #most likely buffer underfill
00214 
00215 
00216   def serialize_numpy(self, buff, numpy):
00217     """
00218     serialize message with numpy array types into buffer
00219     :param buff: buffer, ``StringIO``
00220     :param numpy: numpy python module
00221     """
00222     try:
00223       _x = self.name
00224       length = len(_x)
00225       if python3 or type(_x) == unicode:
00226         _x = _x.encode('utf-8')
00227         length = len(_x)
00228       buff.write(struct.pack('<I%ss'%length, length, _x))
00229       _x = self.display_name
00230       length = len(_x)
00231       if python3 or type(_x) == unicode:
00232         _x = _x.encode('utf-8')
00233         length = len(_x)
00234       buff.write(struct.pack('<I%ss'%length, length, _x))
00235       _x = self.version
00236       length = len(_x)
00237       if python3 or type(_x) == unicode:
00238         _x = _x.encode('utf-8')
00239         length = len(_x)
00240       buff.write(struct.pack('<I%ss'%length, length, _x))
00241       _x = self.latest_version
00242       length = len(_x)
00243       if python3 or type(_x) == unicode:
00244         _x = _x.encode('utf-8')
00245         length = len(_x)
00246       buff.write(struct.pack('<I%ss'%length, length, _x))
00247       _x = self.description
00248       length = len(_x)
00249       if python3 or type(_x) == unicode:
00250         _x = _x.encode('utf-8')
00251         length = len(_x)
00252       buff.write(struct.pack('<I%ss'%length, length, _x))
00253       _x = self.icon.format
00254       length = len(_x)
00255       if python3 or type(_x) == unicode:
00256         _x = _x.encode('utf-8')
00257         length = len(_x)
00258       buff.write(struct.pack('<I%ss'%length, length, _x))
00259       _x = self.icon.data
00260       length = len(_x)
00261       # - if encoded as a list instead, serialize as bytes instead of string
00262       if type(_x) in [list, tuple]:
00263         buff.write(struct.pack('<I%sB'%length, length, *_x))
00264       else:
00265         buff.write(struct.pack('<I%ss'%length, length, _x))
00266       buff.write(_struct_B.pack(self.hidden))
00267     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00268     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00269 
00270   def deserialize_numpy(self, str, numpy):
00271     """
00272     unpack serialized message in str into this message instance using numpy for array types
00273     :param str: byte array of serialized message, ``str``
00274     :param numpy: numpy python module
00275     """
00276     try:
00277       if self.icon is None:
00278         self.icon = turtlebot_app_manager.msg.Icon()
00279       end = 0
00280       start = end
00281       end += 4
00282       (length,) = _struct_I.unpack(str[start:end])
00283       start = end
00284       end += length
00285       if python3:
00286         self.name = str[start:end].decode('utf-8')
00287       else:
00288         self.name = 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         self.display_name = str[start:end].decode('utf-8')
00296       else:
00297         self.display_name = str[start:end]
00298       start = end
00299       end += 4
00300       (length,) = _struct_I.unpack(str[start:end])
00301       start = end
00302       end += length
00303       if python3:
00304         self.version = str[start:end].decode('utf-8')
00305       else:
00306         self.version = str[start:end]
00307       start = end
00308       end += 4
00309       (length,) = _struct_I.unpack(str[start:end])
00310       start = end
00311       end += length
00312       if python3:
00313         self.latest_version = str[start:end].decode('utf-8')
00314       else:
00315         self.latest_version = str[start:end]
00316       start = end
00317       end += 4
00318       (length,) = _struct_I.unpack(str[start:end])
00319       start = end
00320       end += length
00321       if python3:
00322         self.description = str[start:end].decode('utf-8')
00323       else:
00324         self.description = str[start:end]
00325       start = end
00326       end += 4
00327       (length,) = _struct_I.unpack(str[start:end])
00328       start = end
00329       end += length
00330       if python3:
00331         self.icon.format = str[start:end].decode('utf-8')
00332       else:
00333         self.icon.format = str[start:end]
00334       start = end
00335       end += 4
00336       (length,) = _struct_I.unpack(str[start:end])
00337       start = end
00338       end += length
00339       self.icon.data = str[start:end]
00340       start = end
00341       end += 1
00342       (self.hidden,) = _struct_B.unpack(str[start:end])
00343       self.hidden = bool(self.hidden)
00344       return self
00345     except struct.error as e:
00346       raise genpy.DeserializationError(e) #most likely buffer underfill
00347 
00348 _struct_I = genpy.struct_I
00349 _struct_B = struct.Struct("<B")


turtlebot_app_manager
Author(s): Jeremy Leibs, Ken Conley
autogenerated on Mon Oct 6 2014 08:00:31