_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         if python3:
00258           _v3.data = str[start:end].decode('utf-8')
00259         else:
00260           _v3.data = str[start:end]
00261         start = end
00262         end += 1
00263         (val1.hidden,) = _struct_B.unpack(str[start:end])
00264         val1.hidden = bool(val1.hidden)
00265         self.installed_apps.append(val1)
00266       start = end
00267       end += 4
00268       (length,) = _struct_I.unpack(str[start:end])
00269       self.available_apps = []
00270       for i in range(0, length):
00271         val1 = app_manager.msg.ExchangeApp()
00272         start = end
00273         end += 4
00274         (length,) = _struct_I.unpack(str[start:end])
00275         start = end
00276         end += length
00277         if python3:
00278           val1.name = str[start:end].decode('utf-8')
00279         else:
00280           val1.name = str[start:end]
00281         start = end
00282         end += 4
00283         (length,) = _struct_I.unpack(str[start:end])
00284         start = end
00285         end += length
00286         if python3:
00287           val1.display_name = str[start:end].decode('utf-8')
00288         else:
00289           val1.display_name = str[start:end]
00290         start = end
00291         end += 4
00292         (length,) = _struct_I.unpack(str[start:end])
00293         start = end
00294         end += length
00295         if python3:
00296           val1.version = str[start:end].decode('utf-8')
00297         else:
00298           val1.version = str[start:end]
00299         start = end
00300         end += 4
00301         (length,) = _struct_I.unpack(str[start:end])
00302         start = end
00303         end += length
00304         if python3:
00305           val1.latest_version = str[start:end].decode('utf-8')
00306         else:
00307           val1.latest_version = str[start:end]
00308         start = end
00309         end += 4
00310         (length,) = _struct_I.unpack(str[start:end])
00311         start = end
00312         end += length
00313         if python3:
00314           val1.description = str[start:end].decode('utf-8')
00315         else:
00316           val1.description = str[start:end]
00317         _v4 = val1.icon
00318         start = end
00319         end += 4
00320         (length,) = _struct_I.unpack(str[start:end])
00321         start = end
00322         end += length
00323         if python3:
00324           _v4.format = str[start:end].decode('utf-8')
00325         else:
00326           _v4.format = str[start:end]
00327         start = end
00328         end += 4
00329         (length,) = _struct_I.unpack(str[start:end])
00330         start = end
00331         end += length
00332         if python3:
00333           _v4.data = str[start:end].decode('utf-8')
00334         else:
00335           _v4.data = str[start:end]
00336         start = end
00337         end += 1
00338         (val1.hidden,) = _struct_B.unpack(str[start:end])
00339         val1.hidden = bool(val1.hidden)
00340         self.available_apps.append(val1)
00341       return self
00342     except struct.error as e:
00343       raise genpy.DeserializationError(e) #most likely buffer underfill
00344 
00345 
00346   def serialize_numpy(self, buff, numpy):
00347     """
00348     serialize message with numpy array types into buffer
00349     :param buff: buffer, ``StringIO``
00350     :param numpy: numpy python module
00351     """
00352     try:
00353       length = len(self.installed_apps)
00354       buff.write(_struct_I.pack(length))
00355       for val1 in self.installed_apps:
00356         _x = val1.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.display_name
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.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.latest_version
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         _x = val1.description
00381         length = len(_x)
00382         if python3 or type(_x) == unicode:
00383           _x = _x.encode('utf-8')
00384           length = len(_x)
00385         buff.write(struct.pack('<I%ss'%length, length, _x))
00386         _v5 = val1.icon
00387         _x = _v5.format
00388         length = len(_x)
00389         if python3 or type(_x) == unicode:
00390           _x = _x.encode('utf-8')
00391           length = len(_x)
00392         buff.write(struct.pack('<I%ss'%length, length, _x))
00393         _x = _v5.data
00394         length = len(_x)
00395         # - if encoded as a list instead, serialize as bytes instead of string
00396         if type(_x) in [list, tuple]:
00397           buff.write(struct.pack('<I%sB'%length, length, *_x))
00398         else:
00399           buff.write(struct.pack('<I%ss'%length, length, _x))
00400         buff.write(_struct_B.pack(val1.hidden))
00401       length = len(self.available_apps)
00402       buff.write(_struct_I.pack(length))
00403       for val1 in self.available_apps:
00404         _x = val1.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.display_name
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.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.latest_version
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         _x = val1.description
00429         length = len(_x)
00430         if python3 or type(_x) == unicode:
00431           _x = _x.encode('utf-8')
00432           length = len(_x)
00433         buff.write(struct.pack('<I%ss'%length, length, _x))
00434         _v6 = val1.icon
00435         _x = _v6.format
00436         length = len(_x)
00437         if python3 or type(_x) == unicode:
00438           _x = _x.encode('utf-8')
00439           length = len(_x)
00440         buff.write(struct.pack('<I%ss'%length, length, _x))
00441         _x = _v6.data
00442         length = len(_x)
00443         # - if encoded as a list instead, serialize as bytes instead of string
00444         if type(_x) in [list, tuple]:
00445           buff.write(struct.pack('<I%sB'%length, length, *_x))
00446         else:
00447           buff.write(struct.pack('<I%ss'%length, length, _x))
00448         buff.write(_struct_B.pack(val1.hidden))
00449     except struct.error as se: self._check_types(se)
00450     except TypeError as te: self._check_types(te)
00451 
00452   def deserialize_numpy(self, str, numpy):
00453     """
00454     unpack serialized message in str into this message instance using numpy for array types
00455     :param str: byte array of serialized message, ``str``
00456     :param numpy: numpy python module
00457     """
00458     try:
00459       if self.installed_apps is None:
00460         self.installed_apps = None
00461       if self.available_apps is None:
00462         self.available_apps = None
00463       end = 0
00464       start = end
00465       end += 4
00466       (length,) = _struct_I.unpack(str[start:end])
00467       self.installed_apps = []
00468       for i in range(0, length):
00469         val1 = app_manager.msg.ExchangeApp()
00470         start = end
00471         end += 4
00472         (length,) = _struct_I.unpack(str[start:end])
00473         start = end
00474         end += length
00475         if python3:
00476           val1.name = str[start:end].decode('utf-8')
00477         else:
00478           val1.name = str[start:end]
00479         start = end
00480         end += 4
00481         (length,) = _struct_I.unpack(str[start:end])
00482         start = end
00483         end += length
00484         if python3:
00485           val1.display_name = str[start:end].decode('utf-8')
00486         else:
00487           val1.display_name = str[start:end]
00488         start = end
00489         end += 4
00490         (length,) = _struct_I.unpack(str[start:end])
00491         start = end
00492         end += length
00493         if python3:
00494           val1.version = str[start:end].decode('utf-8')
00495         else:
00496           val1.version = str[start:end]
00497         start = end
00498         end += 4
00499         (length,) = _struct_I.unpack(str[start:end])
00500         start = end
00501         end += length
00502         if python3:
00503           val1.latest_version = str[start:end].decode('utf-8')
00504         else:
00505           val1.latest_version = str[start:end]
00506         start = end
00507         end += 4
00508         (length,) = _struct_I.unpack(str[start:end])
00509         start = end
00510         end += length
00511         if python3:
00512           val1.description = str[start:end].decode('utf-8')
00513         else:
00514           val1.description = str[start:end]
00515         _v7 = val1.icon
00516         start = end
00517         end += 4
00518         (length,) = _struct_I.unpack(str[start:end])
00519         start = end
00520         end += length
00521         if python3:
00522           _v7.format = str[start:end].decode('utf-8')
00523         else:
00524           _v7.format = str[start:end]
00525         start = end
00526         end += 4
00527         (length,) = _struct_I.unpack(str[start:end])
00528         start = end
00529         end += length
00530         if python3:
00531           _v7.data = str[start:end].decode('utf-8')
00532         else:
00533           _v7.data = str[start:end]
00534         start = end
00535         end += 1
00536         (val1.hidden,) = _struct_B.unpack(str[start:end])
00537         val1.hidden = bool(val1.hidden)
00538         self.installed_apps.append(val1)
00539       start = end
00540       end += 4
00541       (length,) = _struct_I.unpack(str[start:end])
00542       self.available_apps = []
00543       for i in range(0, length):
00544         val1 = app_manager.msg.ExchangeApp()
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.name = str[start:end].decode('utf-8')
00552         else:
00553           val1.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.display_name = str[start:end].decode('utf-8')
00561         else:
00562           val1.display_name = 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.version = str[start:end].decode('utf-8')
00570         else:
00571           val1.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.latest_version = str[start:end].decode('utf-8')
00579         else:
00580           val1.latest_version = str[start:end]
00581         start = end
00582         end += 4
00583         (length,) = _struct_I.unpack(str[start:end])
00584         start = end
00585         end += length
00586         if python3:
00587           val1.description = str[start:end].decode('utf-8')
00588         else:
00589           val1.description = str[start:end]
00590         _v8 = val1.icon
00591         start = end
00592         end += 4
00593         (length,) = _struct_I.unpack(str[start:end])
00594         start = end
00595         end += length
00596         if python3:
00597           _v8.format = str[start:end].decode('utf-8')
00598         else:
00599           _v8.format = str[start:end]
00600         start = end
00601         end += 4
00602         (length,) = _struct_I.unpack(str[start:end])
00603         start = end
00604         end += length
00605         if python3:
00606           _v8.data = str[start:end].decode('utf-8')
00607         else:
00608           _v8.data = str[start:end]
00609         start = end
00610         end += 1
00611         (val1.hidden,) = _struct_B.unpack(str[start:end])
00612         val1.hidden = bool(val1.hidden)
00613         self.available_apps.append(val1)
00614       return self
00615     except struct.error as e:
00616       raise genpy.DeserializationError(e) #most likely buffer underfill
00617 
00618 _struct_I = genpy.struct_I
00619 _struct_B = struct.Struct("<B")


app_manager
Author(s): Jeremy Leibs, Ken Conley
autogenerated on Mon Dec 2 2013 11:36:52