00001 """autogenerated by genpy from 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 app_manager.msg
00008
00009 class ExchangeApp(genpy.Message):
00010 _md5sum = "ccad20aa9f390121e44c61d218038d78"
00011 _type = "app_manager/ExchangeApp"
00012 _has_header = False
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: 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','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
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 = 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 = 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
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(se)
00136 except TypeError as te: self._check_types(te)
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 = 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 if python3:
00207 self.icon.data = str[start:end].decode('utf-8')
00208 else:
00209 self.icon.data = str[start:end]
00210 start = end
00211 end += 1
00212 (self.hidden,) = _struct_B.unpack(str[start:end])
00213 self.hidden = bool(self.hidden)
00214 return self
00215 except struct.error as e:
00216 raise genpy.DeserializationError(e)
00217
00218
00219 def serialize_numpy(self, buff, numpy):
00220 """
00221 serialize message with numpy array types into buffer
00222 :param buff: buffer, ``StringIO``
00223 :param numpy: numpy python module
00224 """
00225 try:
00226 _x = self.name
00227 length = len(_x)
00228 if python3 or type(_x) == unicode:
00229 _x = _x.encode('utf-8')
00230 length = len(_x)
00231 buff.write(struct.pack('<I%ss'%length, length, _x))
00232 _x = self.display_name
00233 length = len(_x)
00234 if python3 or type(_x) == unicode:
00235 _x = _x.encode('utf-8')
00236 length = len(_x)
00237 buff.write(struct.pack('<I%ss'%length, length, _x))
00238 _x = self.version
00239 length = len(_x)
00240 if python3 or type(_x) == unicode:
00241 _x = _x.encode('utf-8')
00242 length = len(_x)
00243 buff.write(struct.pack('<I%ss'%length, length, _x))
00244 _x = self.latest_version
00245 length = len(_x)
00246 if python3 or type(_x) == unicode:
00247 _x = _x.encode('utf-8')
00248 length = len(_x)
00249 buff.write(struct.pack('<I%ss'%length, length, _x))
00250 _x = self.description
00251 length = len(_x)
00252 if python3 or type(_x) == unicode:
00253 _x = _x.encode('utf-8')
00254 length = len(_x)
00255 buff.write(struct.pack('<I%ss'%length, length, _x))
00256 _x = self.icon.format
00257 length = len(_x)
00258 if python3 or type(_x) == unicode:
00259 _x = _x.encode('utf-8')
00260 length = len(_x)
00261 buff.write(struct.pack('<I%ss'%length, length, _x))
00262 _x = self.icon.data
00263 length = len(_x)
00264
00265 if type(_x) in [list, tuple]:
00266 buff.write(struct.pack('<I%sB'%length, length, *_x))
00267 else:
00268 buff.write(struct.pack('<I%ss'%length, length, _x))
00269 buff.write(_struct_B.pack(self.hidden))
00270 except struct.error as se: self._check_types(se)
00271 except TypeError as te: self._check_types(te)
00272
00273 def deserialize_numpy(self, str, numpy):
00274 """
00275 unpack serialized message in str into this message instance using numpy for array types
00276 :param str: byte array of serialized message, ``str``
00277 :param numpy: numpy python module
00278 """
00279 try:
00280 if self.icon is None:
00281 self.icon = app_manager.msg.Icon()
00282 end = 0
00283 start = end
00284 end += 4
00285 (length,) = _struct_I.unpack(str[start:end])
00286 start = end
00287 end += length
00288 if python3:
00289 self.name = str[start:end].decode('utf-8')
00290 else:
00291 self.name = str[start:end]
00292 start = end
00293 end += 4
00294 (length,) = _struct_I.unpack(str[start:end])
00295 start = end
00296 end += length
00297 if python3:
00298 self.display_name = str[start:end].decode('utf-8')
00299 else:
00300 self.display_name = str[start:end]
00301 start = end
00302 end += 4
00303 (length,) = _struct_I.unpack(str[start:end])
00304 start = end
00305 end += length
00306 if python3:
00307 self.version = str[start:end].decode('utf-8')
00308 else:
00309 self.version = str[start:end]
00310 start = end
00311 end += 4
00312 (length,) = _struct_I.unpack(str[start:end])
00313 start = end
00314 end += length
00315 if python3:
00316 self.latest_version = str[start:end].decode('utf-8')
00317 else:
00318 self.latest_version = str[start:end]
00319 start = end
00320 end += 4
00321 (length,) = _struct_I.unpack(str[start:end])
00322 start = end
00323 end += length
00324 if python3:
00325 self.description = str[start:end].decode('utf-8')
00326 else:
00327 self.description = str[start:end]
00328 start = end
00329 end += 4
00330 (length,) = _struct_I.unpack(str[start:end])
00331 start = end
00332 end += length
00333 if python3:
00334 self.icon.format = str[start:end].decode('utf-8')
00335 else:
00336 self.icon.format = str[start:end]
00337 start = end
00338 end += 4
00339 (length,) = _struct_I.unpack(str[start:end])
00340 start = end
00341 end += length
00342 if python3:
00343 self.icon.data = str[start:end].decode('utf-8')
00344 else:
00345 self.icon.data = str[start:end]
00346 start = end
00347 end += 1
00348 (self.hidden,) = _struct_B.unpack(str[start:end])
00349 self.hidden = bool(self.hidden)
00350 return self
00351 except struct.error as e:
00352 raise genpy.DeserializationError(e)
00353
00354 _struct_I = genpy.struct_I
00355 _struct_B = struct.Struct("<B")