_AppInstallationState.py
Go to the documentation of this file.
00001 """autogenerated by genpy from app_manager/AppInstallationState.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 AppInstallationState(genpy.Message):
00010   _md5sum = "46d45bbda08250199267aff8c0ee8c41"
00011   _type = "app_manager/AppInstallationState"
00012   _has_header = False #flag to mark the presence of a Header object
00013   _full_text = """ExchangeApp[] installed_apps
00014 ExchangeApp[] available_apps
00015 
00016 ================================================================================
00017 MSG: app_manager/ExchangeApp
00018 # app name
00019 string name
00020 # user-friendly display name of application
00021 string display_name
00022 # the version of the package currently installed
00023 string version
00024 # latest version of the package avaliable
00025 string latest_version
00026 # the detailed description of the app
00027 string description
00028 # icon for showing app
00029 Icon icon
00030 # hidden apps are not show - used for cases where multiple apps are in a deb
00031 bool hidden
00032 ================================================================================
00033 MSG: app_manager/Icon
00034 # Image data format.  "jpeg" or "png"
00035 string format
00036 
00037 # Image data.
00038 uint8[] data
00039 
00040 """
00041   __slots__ = ['installed_apps','available_apps']
00042   _slot_types = ['app_manager/ExchangeApp[]','app_manager/ExchangeApp[]']
00043 
00044   def __init__(self, *args, **kwds):
00045     """
00046     Constructor. Any message fields that are implicitly/explicitly
00047     set to None will be assigned a default value. The recommend
00048     use is keyword arguments as this is more robust to future message
00049     changes.  You cannot mix in-order arguments and keyword arguments.
00050 
00051     The available fields are:
00052        installed_apps,available_apps
00053 
00054     :param args: complete set of field values, in .msg order
00055     :param kwds: use keyword arguments corresponding to message field names
00056     to set specific fields.
00057     """
00058     if args or kwds:
00059       super(AppInstallationState, self).__init__(*args, **kwds)
00060       #message fields cannot be None, assign default values for those that are
00061       if self.installed_apps is None:
00062         self.installed_apps = []
00063       if self.available_apps is None:
00064         self.available_apps = []
00065     else:
00066       self.installed_apps = []
00067       self.available_apps = []
00068 
00069   def _get_types(self):
00070     """
00071     internal API method
00072     """
00073     return self._slot_types
00074 
00075   def serialize(self, buff):
00076     """
00077     serialize message into buffer
00078     :param buff: buffer, ``StringIO``
00079     """
00080     try:
00081       length = len(self.installed_apps)
00082       buff.write(_struct_I.pack(length))
00083       for val1 in self.installed_apps:
00084         _x = val1.name
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 = val1.display_name
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 = val1.version
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 = val1.latest_version
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         _x = val1.description
00109         length = len(_x)
00110         if python3 or type(_x) == unicode:
00111           _x = _x.encode('utf-8')
00112           length = len(_x)
00113         buff.write(struct.pack('<I%ss'%length, length, _x))
00114         _v1 = val1.icon
00115         _x = _v1.format
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 = _v1.data
00122         length = len(_x)
00123         # - if encoded as a list instead, serialize as bytes instead of string
00124         if type(_x) in [list, tuple]:
00125           buff.write(struct.pack('<I%sB'%length, length, *_x))
00126         else:
00127           buff.write(struct.pack('<I%ss'%length, length, _x))
00128         buff.write(_struct_B.pack(val1.hidden))
00129       length = len(self.available_apps)
00130       buff.write(_struct_I.pack(length))
00131       for val1 in self.available_apps:
00132         _x = val1.name
00133         length = len(_x)
00134         if python3 or type(_x) == unicode:
00135           _x = _x.encode('utf-8')
00136           length = len(_x)
00137         buff.write(struct.pack('<I%ss'%length, length, _x))
00138         _x = val1.display_name
00139         length = len(_x)
00140         if python3 or type(_x) == unicode:
00141           _x = _x.encode('utf-8')
00142           length = len(_x)
00143         buff.write(struct.pack('<I%ss'%length, length, _x))
00144         _x = val1.version
00145         length = len(_x)
00146         if python3 or type(_x) == unicode:
00147           _x = _x.encode('utf-8')
00148           length = len(_x)
00149         buff.write(struct.pack('<I%ss'%length, length, _x))
00150         _x = val1.latest_version
00151         length = len(_x)
00152         if python3 or type(_x) == unicode:
00153           _x = _x.encode('utf-8')
00154           length = len(_x)
00155         buff.write(struct.pack('<I%ss'%length, length, _x))
00156         _x = val1.description
00157         length = len(_x)
00158         if python3 or type(_x) == unicode:
00159           _x = _x.encode('utf-8')
00160           length = len(_x)
00161         buff.write(struct.pack('<I%ss'%length, length, _x))
00162         _v2 = val1.icon
00163         _x = _v2.format
00164         length = len(_x)
00165         if python3 or type(_x) == unicode:
00166           _x = _x.encode('utf-8')
00167           length = len(_x)
00168         buff.write(struct.pack('<I%ss'%length, length, _x))
00169         _x = _v2.data
00170         length = len(_x)
00171         # - if encoded as a list instead, serialize as bytes instead of string
00172         if type(_x) in [list, tuple]:
00173           buff.write(struct.pack('<I%sB'%length, length, *_x))
00174         else:
00175           buff.write(struct.pack('<I%ss'%length, length, _x))
00176         buff.write(_struct_B.pack(val1.hidden))
00177     except struct.error as se: self._check_types(se)
00178     except TypeError as te: self._check_types(te)
00179 
00180   def deserialize(self, str):
00181     """
00182     unpack serialized message in str into this message instance
00183     :param str: byte array of serialized message, ``str``
00184     """
00185     try:
00186       if self.installed_apps is None:
00187         self.installed_apps = None
00188       if self.available_apps is None:
00189         self.available_apps = None
00190       end = 0
00191       start = end
00192       end += 4
00193       (length,) = _struct_I.unpack(str[start:end])
00194       self.installed_apps = []
00195       for i in range(0, length):
00196         val1 = app_manager.msg.ExchangeApp()
00197         start = end
00198         end += 4
00199         (length,) = _struct_I.unpack(str[start:end])
00200         start = end
00201         end += length
00202         if python3:
00203           val1.name = str[start:end].decode('utf-8')
00204         else:
00205           val1.name = str[start:end]
00206         start = end
00207         end += 4
00208         (length,) = _struct_I.unpack(str[start:end])
00209         start = end
00210         end += length
00211         if python3:
00212           val1.display_name = str[start:end].decode('utf-8')
00213         else:
00214           val1.display_name = str[start:end]
00215         start = end
00216         end += 4
00217         (length,) = _struct_I.unpack(str[start:end])
00218         start = end
00219         end += length
00220         if python3:
00221           val1.version = str[start:end].decode('utf-8')
00222         else:
00223           val1.version = str[start:end]
00224         start = end
00225         end += 4
00226         (length,) = _struct_I.unpack(str[start:end])
00227         start = end
00228         end += length
00229         if python3:
00230           val1.latest_version = str[start:end].decode('utf-8')
00231         else:
00232           val1.latest_version = str[start:end]
00233         start = end
00234         end += 4
00235         (length,) = _struct_I.unpack(str[start:end])
00236         start = end
00237         end += length
00238         if python3:
00239           val1.description = str[start:end].decode('utf-8')
00240         else:
00241           val1.description = str[start:end]
00242         _v3 = val1.icon
00243         start = end
00244         end += 4
00245         (length,) = _struct_I.unpack(str[start:end])
00246         start = end
00247         end += length
00248         if python3:
00249           _v3.format = str[start:end].decode('utf-8')
00250         else:
00251           _v3.format = str[start:end]
00252         start = end
00253         end += 4
00254         (length,) = _struct_I.unpack(str[start:end])
00255         start = end
00256         end += length
00257         _v3.data = str[start:end]
00258         start = end
00259         end += 1
00260         (val1.hidden,) = _struct_B.unpack(str[start:end])
00261         val1.hidden = bool(val1.hidden)
00262         self.installed_apps.append(val1)
00263       start = end
00264       end += 4
00265       (length,) = _struct_I.unpack(str[start:end])
00266       self.available_apps = []
00267       for i in range(0, length):
00268         val1 = app_manager.msg.ExchangeApp()
00269         start = end
00270         end += 4
00271         (length,) = _struct_I.unpack(str[start:end])
00272         start = end
00273         end += length
00274         if python3:
00275           val1.name = str[start:end].decode('utf-8')
00276         else:
00277           val1.name = str[start:end]
00278         start = end
00279         end += 4
00280         (length,) = _struct_I.unpack(str[start:end])
00281         start = end
00282         end += length
00283         if python3:
00284           val1.display_name = str[start:end].decode('utf-8')
00285         else:
00286           val1.display_name = str[start:end]
00287         start = end
00288         end += 4
00289         (length,) = _struct_I.unpack(str[start:end])
00290         start = end
00291         end += length
00292         if python3:
00293           val1.version = str[start:end].decode('utf-8')
00294         else:
00295           val1.version = str[start:end]
00296         start = end
00297         end += 4
00298         (length,) = _struct_I.unpack(str[start:end])
00299         start = end
00300         end += length
00301         if python3:
00302           val1.latest_version = str[start:end].decode('utf-8')
00303         else:
00304           val1.latest_version = str[start:end]
00305         start = end
00306         end += 4
00307         (length,) = _struct_I.unpack(str[start:end])
00308         start = end
00309         end += length
00310         if python3:
00311           val1.description = str[start:end].decode('utf-8')
00312         else:
00313           val1.description = str[start:end]
00314         _v4 = val1.icon
00315         start = end
00316         end += 4
00317         (length,) = _struct_I.unpack(str[start:end])
00318         start = end
00319         end += length
00320         if python3:
00321           _v4.format = str[start:end].decode('utf-8')
00322         else:
00323           _v4.format = str[start:end]
00324         start = end
00325         end += 4
00326         (length,) = _struct_I.unpack(str[start:end])
00327         start = end
00328         end += length
00329         _v4.data = str[start:end]
00330         start = end
00331         end += 1
00332         (val1.hidden,) = _struct_B.unpack(str[start:end])
00333         val1.hidden = bool(val1.hidden)
00334         self.available_apps.append(val1)
00335       return self
00336     except struct.error as e:
00337       raise genpy.DeserializationError(e) #most likely buffer underfill
00338 
00339 
00340   def serialize_numpy(self, buff, numpy):
00341     """
00342     serialize message with numpy array types into buffer
00343     :param buff: buffer, ``StringIO``
00344     :param numpy: numpy python module
00345     """
00346     try:
00347       length = len(self.installed_apps)
00348       buff.write(_struct_I.pack(length))
00349       for val1 in self.installed_apps:
00350         _x = val1.name
00351         length = len(_x)
00352         if python3 or type(_x) == unicode:
00353           _x = _x.encode('utf-8')
00354           length = len(_x)
00355         buff.write(struct.pack('<I%ss'%length, length, _x))
00356         _x = val1.display_name
00357         length = len(_x)
00358         if python3 or type(_x) == unicode:
00359           _x = _x.encode('utf-8')
00360           length = len(_x)
00361         buff.write(struct.pack('<I%ss'%length, length, _x))
00362         _x = val1.version
00363         length = len(_x)
00364         if python3 or type(_x) == unicode:
00365           _x = _x.encode('utf-8')
00366           length = len(_x)
00367         buff.write(struct.pack('<I%ss'%length, length, _x))
00368         _x = val1.latest_version
00369         length = len(_x)
00370         if python3 or type(_x) == unicode:
00371           _x = _x.encode('utf-8')
00372           length = len(_x)
00373         buff.write(struct.pack('<I%ss'%length, length, _x))
00374         _x = val1.description
00375         length = len(_x)
00376         if python3 or type(_x) == unicode:
00377           _x = _x.encode('utf-8')
00378           length = len(_x)
00379         buff.write(struct.pack('<I%ss'%length, length, _x))
00380         _v5 = val1.icon
00381         _x = _v5.format
00382         length = len(_x)
00383         if python3 or type(_x) == unicode:
00384           _x = _x.encode('utf-8')
00385           length = len(_x)
00386         buff.write(struct.pack('<I%ss'%length, length, _x))
00387         _x = _v5.data
00388         length = len(_x)
00389         # - if encoded as a list instead, serialize as bytes instead of string
00390         if type(_x) in [list, tuple]:
00391           buff.write(struct.pack('<I%sB'%length, length, *_x))
00392         else:
00393           buff.write(struct.pack('<I%ss'%length, length, _x))
00394         buff.write(_struct_B.pack(val1.hidden))
00395       length = len(self.available_apps)
00396       buff.write(_struct_I.pack(length))
00397       for val1 in self.available_apps:
00398         _x = val1.name
00399         length = len(_x)
00400         if python3 or type(_x) == unicode:
00401           _x = _x.encode('utf-8')
00402           length = len(_x)
00403         buff.write(struct.pack('<I%ss'%length, length, _x))
00404         _x = val1.display_name
00405         length = len(_x)
00406         if python3 or type(_x) == unicode:
00407           _x = _x.encode('utf-8')
00408           length = len(_x)
00409         buff.write(struct.pack('<I%ss'%length, length, _x))
00410         _x = val1.version
00411         length = len(_x)
00412         if python3 or type(_x) == unicode:
00413           _x = _x.encode('utf-8')
00414           length = len(_x)
00415         buff.write(struct.pack('<I%ss'%length, length, _x))
00416         _x = val1.latest_version
00417         length = len(_x)
00418         if python3 or type(_x) == unicode:
00419           _x = _x.encode('utf-8')
00420           length = len(_x)
00421         buff.write(struct.pack('<I%ss'%length, length, _x))
00422         _x = val1.description
00423         length = len(_x)
00424         if python3 or type(_x) == unicode:
00425           _x = _x.encode('utf-8')
00426           length = len(_x)
00427         buff.write(struct.pack('<I%ss'%length, length, _x))
00428         _v6 = val1.icon
00429         _x = _v6.format
00430         length = len(_x)
00431         if python3 or type(_x) == unicode:
00432           _x = _x.encode('utf-8')
00433           length = len(_x)
00434         buff.write(struct.pack('<I%ss'%length, length, _x))
00435         _x = _v6.data
00436         length = len(_x)
00437         # - if encoded as a list instead, serialize as bytes instead of string
00438         if type(_x) in [list, tuple]:
00439           buff.write(struct.pack('<I%sB'%length, length, *_x))
00440         else:
00441           buff.write(struct.pack('<I%ss'%length, length, _x))
00442         buff.write(_struct_B.pack(val1.hidden))
00443     except struct.error as se: self._check_types(se)
00444     except TypeError as te: self._check_types(te)
00445 
00446   def deserialize_numpy(self, str, numpy):
00447     """
00448     unpack serialized message in str into this message instance using numpy for array types
00449     :param str: byte array of serialized message, ``str``
00450     :param numpy: numpy python module
00451     """
00452     try:
00453       if self.installed_apps is None:
00454         self.installed_apps = None
00455       if self.available_apps is None:
00456         self.available_apps = None
00457       end = 0
00458       start = end
00459       end += 4
00460       (length,) = _struct_I.unpack(str[start:end])
00461       self.installed_apps = []
00462       for i in range(0, length):
00463         val1 = app_manager.msg.ExchangeApp()
00464         start = end
00465         end += 4
00466         (length,) = _struct_I.unpack(str[start:end])
00467         start = end
00468         end += length
00469         if python3:
00470           val1.name = str[start:end].decode('utf-8')
00471         else:
00472           val1.name = str[start:end]
00473         start = end
00474         end += 4
00475         (length,) = _struct_I.unpack(str[start:end])
00476         start = end
00477         end += length
00478         if python3:
00479           val1.display_name = str[start:end].decode('utf-8')
00480         else:
00481           val1.display_name = str[start:end]
00482         start = end
00483         end += 4
00484         (length,) = _struct_I.unpack(str[start:end])
00485         start = end
00486         end += length
00487         if python3:
00488           val1.version = str[start:end].decode('utf-8')
00489         else:
00490           val1.version = str[start:end]
00491         start = end
00492         end += 4
00493         (length,) = _struct_I.unpack(str[start:end])
00494         start = end
00495         end += length
00496         if python3:
00497           val1.latest_version = str[start:end].decode('utf-8')
00498         else:
00499           val1.latest_version = str[start:end]
00500         start = end
00501         end += 4
00502         (length,) = _struct_I.unpack(str[start:end])
00503         start = end
00504         end += length
00505         if python3:
00506           val1.description = str[start:end].decode('utf-8')
00507         else:
00508           val1.description = str[start:end]
00509         _v7 = val1.icon
00510         start = end
00511         end += 4
00512         (length,) = _struct_I.unpack(str[start:end])
00513         start = end
00514         end += length
00515         if python3:
00516           _v7.format = str[start:end].decode('utf-8')
00517         else:
00518           _v7.format = str[start:end]
00519         start = end
00520         end += 4
00521         (length,) = _struct_I.unpack(str[start:end])
00522         start = end
00523         end += length
00524         _v7.data = str[start:end]
00525         start = end
00526         end += 1
00527         (val1.hidden,) = _struct_B.unpack(str[start:end])
00528         val1.hidden = bool(val1.hidden)
00529         self.installed_apps.append(val1)
00530       start = end
00531       end += 4
00532       (length,) = _struct_I.unpack(str[start:end])
00533       self.available_apps = []
00534       for i in range(0, length):
00535         val1 = app_manager.msg.ExchangeApp()
00536         start = end
00537         end += 4
00538         (length,) = _struct_I.unpack(str[start:end])
00539         start = end
00540         end += length
00541         if python3:
00542           val1.name = str[start:end].decode('utf-8')
00543         else:
00544           val1.name = str[start:end]
00545         start = end
00546         end += 4
00547         (length,) = _struct_I.unpack(str[start:end])
00548         start = end
00549         end += length
00550         if python3:
00551           val1.display_name = str[start:end].decode('utf-8')
00552         else:
00553           val1.display_name = str[start:end]
00554         start = end
00555         end += 4
00556         (length,) = _struct_I.unpack(str[start:end])
00557         start = end
00558         end += length
00559         if python3:
00560           val1.version = str[start:end].decode('utf-8')
00561         else:
00562           val1.version = str[start:end]
00563         start = end
00564         end += 4
00565         (length,) = _struct_I.unpack(str[start:end])
00566         start = end
00567         end += length
00568         if python3:
00569           val1.latest_version = str[start:end].decode('utf-8')
00570         else:
00571           val1.latest_version = str[start:end]
00572         start = end
00573         end += 4
00574         (length,) = _struct_I.unpack(str[start:end])
00575         start = end
00576         end += length
00577         if python3:
00578           val1.description = str[start:end].decode('utf-8')
00579         else:
00580           val1.description = str[start:end]
00581         _v8 = val1.icon
00582         start = end
00583         end += 4
00584         (length,) = _struct_I.unpack(str[start:end])
00585         start = end
00586         end += length
00587         if python3:
00588           _v8.format = str[start:end].decode('utf-8')
00589         else:
00590           _v8.format = str[start:end]
00591         start = end
00592         end += 4
00593         (length,) = _struct_I.unpack(str[start:end])
00594         start = end
00595         end += length
00596         _v8.data = str[start:end]
00597         start = end
00598         end += 1
00599         (val1.hidden,) = _struct_B.unpack(str[start:end])
00600         val1.hidden = bool(val1.hidden)
00601         self.available_apps.append(val1)
00602       return self
00603     except struct.error as e:
00604       raise genpy.DeserializationError(e) #most likely buffer underfill
00605 
00606 _struct_I = genpy.struct_I
00607 _struct_B = struct.Struct("<B")


app_manager
Author(s): Jeremy Leibs, Ken Conley
autogenerated on Mon Dec 2 2013 13:03:54