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