$search
00001 """autogenerated by genmsg_py from AppInstallationState.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import app_manager.msg 00006 00007 class AppInstallationState(roslib.message.Message): 00008 _md5sum = "46d45bbda08250199267aff8c0ee8c41" 00009 _type = "app_manager/AppInstallationState" 00010 _has_header = False #flag to mark the presence of a Header object 00011 _full_text = """ExchangeApp[] installed_apps 00012 ExchangeApp[] available_apps 00013 00014 ================================================================================ 00015 MSG: app_manager/ExchangeApp 00016 # app name 00017 string name 00018 # user-friendly display name of application 00019 string display_name 00020 # the version of the package currently installed 00021 string version 00022 # latest version of the package avaliable 00023 string latest_version 00024 # the detailed description of the app 00025 string description 00026 # icon for showing app 00027 Icon icon 00028 # hidden apps are not show - used for cases where multiple apps are in a deb 00029 bool hidden 00030 ================================================================================ 00031 MSG: app_manager/Icon 00032 # Image data format. "jpeg" or "png" 00033 string format 00034 00035 # Image data. 00036 uint8[] data 00037 00038 """ 00039 __slots__ = ['installed_apps','available_apps'] 00040 _slot_types = ['app_manager/ExchangeApp[]','app_manager/ExchangeApp[]'] 00041 00042 def __init__(self, *args, **kwds): 00043 """ 00044 Constructor. Any message fields that are implicitly/explicitly 00045 set to None will be assigned a default value. The recommend 00046 use is keyword arguments as this is more robust to future message 00047 changes. You cannot mix in-order arguments and keyword arguments. 00048 00049 The available fields are: 00050 installed_apps,available_apps 00051 00052 @param args: complete set of field values, in .msg order 00053 @param kwds: use keyword arguments corresponding to message field names 00054 to set specific fields. 00055 """ 00056 if args or kwds: 00057 super(AppInstallationState, self).__init__(*args, **kwds) 00058 #message fields cannot be None, assign default values for those that are 00059 if self.installed_apps is None: 00060 self.installed_apps = [] 00061 if self.available_apps is None: 00062 self.available_apps = [] 00063 else: 00064 self.installed_apps = [] 00065 self.available_apps = [] 00066 00067 def _get_types(self): 00068 """ 00069 internal API method 00070 """ 00071 return self._slot_types 00072 00073 def serialize(self, buff): 00074 """ 00075 serialize message into buffer 00076 @param buff: buffer 00077 @type buff: StringIO 00078 """ 00079 try: 00080 length = len(self.installed_apps) 00081 buff.write(_struct_I.pack(length)) 00082 for val1 in self.installed_apps: 00083 _x = val1.name 00084 length = len(_x) 00085 buff.write(struct.pack('<I%ss'%length, length, _x)) 00086 _x = val1.display_name 00087 length = len(_x) 00088 buff.write(struct.pack('<I%ss'%length, length, _x)) 00089 _x = val1.version 00090 length = len(_x) 00091 buff.write(struct.pack('<I%ss'%length, length, _x)) 00092 _x = val1.latest_version 00093 length = len(_x) 00094 buff.write(struct.pack('<I%ss'%length, length, _x)) 00095 _x = val1.description 00096 length = len(_x) 00097 buff.write(struct.pack('<I%ss'%length, length, _x)) 00098 _v1 = val1.icon 00099 _x = _v1.format 00100 length = len(_x) 00101 buff.write(struct.pack('<I%ss'%length, length, _x)) 00102 _x = _v1.data 00103 length = len(_x) 00104 # - if encoded as a list instead, serialize as bytes instead of string 00105 if type(_x) in [list, tuple]: 00106 buff.write(struct.pack('<I%sB'%length, length, *_x)) 00107 else: 00108 buff.write(struct.pack('<I%ss'%length, length, _x)) 00109 buff.write(_struct_B.pack(val1.hidden)) 00110 length = len(self.available_apps) 00111 buff.write(_struct_I.pack(length)) 00112 for val1 in self.available_apps: 00113 _x = val1.name 00114 length = len(_x) 00115 buff.write(struct.pack('<I%ss'%length, length, _x)) 00116 _x = val1.display_name 00117 length = len(_x) 00118 buff.write(struct.pack('<I%ss'%length, length, _x)) 00119 _x = val1.version 00120 length = len(_x) 00121 buff.write(struct.pack('<I%ss'%length, length, _x)) 00122 _x = val1.latest_version 00123 length = len(_x) 00124 buff.write(struct.pack('<I%ss'%length, length, _x)) 00125 _x = val1.description 00126 length = len(_x) 00127 buff.write(struct.pack('<I%ss'%length, length, _x)) 00128 _v2 = val1.icon 00129 _x = _v2.format 00130 length = len(_x) 00131 buff.write(struct.pack('<I%ss'%length, length, _x)) 00132 _x = _v2.data 00133 length = len(_x) 00134 # - if encoded as a list instead, serialize as bytes instead of string 00135 if type(_x) in [list, tuple]: 00136 buff.write(struct.pack('<I%sB'%length, length, *_x)) 00137 else: 00138 buff.write(struct.pack('<I%ss'%length, length, _x)) 00139 buff.write(_struct_B.pack(val1.hidden)) 00140 except struct.error as se: self._check_types(se) 00141 except TypeError as te: self._check_types(te) 00142 00143 def deserialize(self, str): 00144 """ 00145 unpack serialized message in str into this message instance 00146 @param str: byte array of serialized message 00147 @type str: str 00148 """ 00149 try: 00150 end = 0 00151 start = end 00152 end += 4 00153 (length,) = _struct_I.unpack(str[start:end]) 00154 self.installed_apps = [] 00155 for i in range(0, length): 00156 val1 = app_manager.msg.ExchangeApp() 00157 start = end 00158 end += 4 00159 (length,) = _struct_I.unpack(str[start:end]) 00160 start = end 00161 end += length 00162 val1.name = str[start:end] 00163 start = end 00164 end += 4 00165 (length,) = _struct_I.unpack(str[start:end]) 00166 start = end 00167 end += length 00168 val1.display_name = str[start:end] 00169 start = end 00170 end += 4 00171 (length,) = _struct_I.unpack(str[start:end]) 00172 start = end 00173 end += length 00174 val1.version = str[start:end] 00175 start = end 00176 end += 4 00177 (length,) = _struct_I.unpack(str[start:end]) 00178 start = end 00179 end += length 00180 val1.latest_version = str[start:end] 00181 start = end 00182 end += 4 00183 (length,) = _struct_I.unpack(str[start:end]) 00184 start = end 00185 end += length 00186 val1.description = str[start:end] 00187 _v3 = val1.icon 00188 start = end 00189 end += 4 00190 (length,) = _struct_I.unpack(str[start:end]) 00191 start = end 00192 end += length 00193 _v3.format = str[start:end] 00194 start = end 00195 end += 4 00196 (length,) = _struct_I.unpack(str[start:end]) 00197 start = end 00198 end += length 00199 _v3.data = str[start:end] 00200 start = end 00201 end += 1 00202 (val1.hidden,) = _struct_B.unpack(str[start:end]) 00203 val1.hidden = bool(val1.hidden) 00204 self.installed_apps.append(val1) 00205 start = end 00206 end += 4 00207 (length,) = _struct_I.unpack(str[start:end]) 00208 self.available_apps = [] 00209 for i in range(0, length): 00210 val1 = app_manager.msg.ExchangeApp() 00211 start = end 00212 end += 4 00213 (length,) = _struct_I.unpack(str[start:end]) 00214 start = end 00215 end += length 00216 val1.name = str[start:end] 00217 start = end 00218 end += 4 00219 (length,) = _struct_I.unpack(str[start:end]) 00220 start = end 00221 end += length 00222 val1.display_name = str[start:end] 00223 start = end 00224 end += 4 00225 (length,) = _struct_I.unpack(str[start:end]) 00226 start = end 00227 end += length 00228 val1.version = str[start:end] 00229 start = end 00230 end += 4 00231 (length,) = _struct_I.unpack(str[start:end]) 00232 start = end 00233 end += length 00234 val1.latest_version = str[start:end] 00235 start = end 00236 end += 4 00237 (length,) = _struct_I.unpack(str[start:end]) 00238 start = end 00239 end += length 00240 val1.description = str[start:end] 00241 _v4 = val1.icon 00242 start = end 00243 end += 4 00244 (length,) = _struct_I.unpack(str[start:end]) 00245 start = end 00246 end += length 00247 _v4.format = str[start:end] 00248 start = end 00249 end += 4 00250 (length,) = _struct_I.unpack(str[start:end]) 00251 start = end 00252 end += length 00253 _v4.data = str[start:end] 00254 start = end 00255 end += 1 00256 (val1.hidden,) = _struct_B.unpack(str[start:end]) 00257 val1.hidden = bool(val1.hidden) 00258 self.available_apps.append(val1) 00259 return self 00260 except struct.error as e: 00261 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00262 00263 00264 def serialize_numpy(self, buff, numpy): 00265 """ 00266 serialize message with numpy array types into buffer 00267 @param buff: buffer 00268 @type buff: StringIO 00269 @param numpy: numpy python module 00270 @type numpy module 00271 """ 00272 try: 00273 length = len(self.installed_apps) 00274 buff.write(_struct_I.pack(length)) 00275 for val1 in self.installed_apps: 00276 _x = val1.name 00277 length = len(_x) 00278 buff.write(struct.pack('<I%ss'%length, length, _x)) 00279 _x = val1.display_name 00280 length = len(_x) 00281 buff.write(struct.pack('<I%ss'%length, length, _x)) 00282 _x = val1.version 00283 length = len(_x) 00284 buff.write(struct.pack('<I%ss'%length, length, _x)) 00285 _x = val1.latest_version 00286 length = len(_x) 00287 buff.write(struct.pack('<I%ss'%length, length, _x)) 00288 _x = val1.description 00289 length = len(_x) 00290 buff.write(struct.pack('<I%ss'%length, length, _x)) 00291 _v5 = val1.icon 00292 _x = _v5.format 00293 length = len(_x) 00294 buff.write(struct.pack('<I%ss'%length, length, _x)) 00295 _x = _v5.data 00296 length = len(_x) 00297 # - if encoded as a list instead, serialize as bytes instead of string 00298 if type(_x) in [list, tuple]: 00299 buff.write(struct.pack('<I%sB'%length, length, *_x)) 00300 else: 00301 buff.write(struct.pack('<I%ss'%length, length, _x)) 00302 buff.write(_struct_B.pack(val1.hidden)) 00303 length = len(self.available_apps) 00304 buff.write(_struct_I.pack(length)) 00305 for val1 in self.available_apps: 00306 _x = val1.name 00307 length = len(_x) 00308 buff.write(struct.pack('<I%ss'%length, length, _x)) 00309 _x = val1.display_name 00310 length = len(_x) 00311 buff.write(struct.pack('<I%ss'%length, length, _x)) 00312 _x = val1.version 00313 length = len(_x) 00314 buff.write(struct.pack('<I%ss'%length, length, _x)) 00315 _x = val1.latest_version 00316 length = len(_x) 00317 buff.write(struct.pack('<I%ss'%length, length, _x)) 00318 _x = val1.description 00319 length = len(_x) 00320 buff.write(struct.pack('<I%ss'%length, length, _x)) 00321 _v6 = val1.icon 00322 _x = _v6.format 00323 length = len(_x) 00324 buff.write(struct.pack('<I%ss'%length, length, _x)) 00325 _x = _v6.data 00326 length = len(_x) 00327 # - if encoded as a list instead, serialize as bytes instead of string 00328 if type(_x) in [list, tuple]: 00329 buff.write(struct.pack('<I%sB'%length, length, *_x)) 00330 else: 00331 buff.write(struct.pack('<I%ss'%length, length, _x)) 00332 buff.write(_struct_B.pack(val1.hidden)) 00333 except struct.error as se: self._check_types(se) 00334 except TypeError as te: self._check_types(te) 00335 00336 def deserialize_numpy(self, str, numpy): 00337 """ 00338 unpack serialized message in str into this message instance using numpy for array types 00339 @param str: byte array of serialized message 00340 @type str: str 00341 @param numpy: numpy python module 00342 @type numpy: module 00343 """ 00344 try: 00345 end = 0 00346 start = end 00347 end += 4 00348 (length,) = _struct_I.unpack(str[start:end]) 00349 self.installed_apps = [] 00350 for i in range(0, length): 00351 val1 = app_manager.msg.ExchangeApp() 00352 start = end 00353 end += 4 00354 (length,) = _struct_I.unpack(str[start:end]) 00355 start = end 00356 end += length 00357 val1.name = str[start:end] 00358 start = end 00359 end += 4 00360 (length,) = _struct_I.unpack(str[start:end]) 00361 start = end 00362 end += length 00363 val1.display_name = str[start:end] 00364 start = end 00365 end += 4 00366 (length,) = _struct_I.unpack(str[start:end]) 00367 start = end 00368 end += length 00369 val1.version = str[start:end] 00370 start = end 00371 end += 4 00372 (length,) = _struct_I.unpack(str[start:end]) 00373 start = end 00374 end += length 00375 val1.latest_version = str[start:end] 00376 start = end 00377 end += 4 00378 (length,) = _struct_I.unpack(str[start:end]) 00379 start = end 00380 end += length 00381 val1.description = str[start:end] 00382 _v7 = val1.icon 00383 start = end 00384 end += 4 00385 (length,) = _struct_I.unpack(str[start:end]) 00386 start = end 00387 end += length 00388 _v7.format = str[start:end] 00389 start = end 00390 end += 4 00391 (length,) = _struct_I.unpack(str[start:end]) 00392 start = end 00393 end += length 00394 _v7.data = str[start:end] 00395 start = end 00396 end += 1 00397 (val1.hidden,) = _struct_B.unpack(str[start:end]) 00398 val1.hidden = bool(val1.hidden) 00399 self.installed_apps.append(val1) 00400 start = end 00401 end += 4 00402 (length,) = _struct_I.unpack(str[start:end]) 00403 self.available_apps = [] 00404 for i in range(0, length): 00405 val1 = app_manager.msg.ExchangeApp() 00406 start = end 00407 end += 4 00408 (length,) = _struct_I.unpack(str[start:end]) 00409 start = end 00410 end += length 00411 val1.name = str[start:end] 00412 start = end 00413 end += 4 00414 (length,) = _struct_I.unpack(str[start:end]) 00415 start = end 00416 end += length 00417 val1.display_name = str[start:end] 00418 start = end 00419 end += 4 00420 (length,) = _struct_I.unpack(str[start:end]) 00421 start = end 00422 end += length 00423 val1.version = str[start:end] 00424 start = end 00425 end += 4 00426 (length,) = _struct_I.unpack(str[start:end]) 00427 start = end 00428 end += length 00429 val1.latest_version = str[start:end] 00430 start = end 00431 end += 4 00432 (length,) = _struct_I.unpack(str[start:end]) 00433 start = end 00434 end += length 00435 val1.description = str[start:end] 00436 _v8 = val1.icon 00437 start = end 00438 end += 4 00439 (length,) = _struct_I.unpack(str[start:end]) 00440 start = end 00441 end += length 00442 _v8.format = str[start:end] 00443 start = end 00444 end += 4 00445 (length,) = _struct_I.unpack(str[start:end]) 00446 start = end 00447 end += length 00448 _v8.data = str[start:end] 00449 start = end 00450 end += 1 00451 (val1.hidden,) = _struct_B.unpack(str[start:end]) 00452 val1.hidden = bool(val1.hidden) 00453 self.available_apps.append(val1) 00454 return self 00455 except struct.error as e: 00456 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00457 00458 _struct_I = roslib.message.struct_I 00459 _struct_B = struct.Struct("<B")