_Application.py
Go to the documentation of this file.
1 """autogenerated by genpy from launchman/Application.msg. Do not edit."""
2 import sys
3 python3 = True if sys.hexversion > 0x03000000 else False
4 import genpy
5 import struct
6 
7 
8 class Application(genpy.Message):
9  _md5sum = "f6a16a9c297a883b8eb15bf869d26eca"
10  _type = "launchman/Application"
11  _has_header = False #flag to mark the presence of a Header object
12  _full_text = """string taskid
13 string name
14 string status
15 string icon
16 string provides
17 string depends
18 
19 """
20  __slots__ = ['taskid','name','status','icon','provides','depends']
21  _slot_types = ['string','string','string','string','string','string']
22 
23  def __init__(self, *args, **kwds):
24  """
25  Constructor. Any message fields that are implicitly/explicitly
26  set to None will be assigned a default value. The recommend
27  use is keyword arguments as this is more robust to future message
28  changes. You cannot mix in-order arguments and keyword arguments.
29 
30  The available fields are:
31  taskid,name,status,icon,provides,depends
32 
33  :param args: complete set of field values, in .msg order
34  :param kwds: use keyword arguments corresponding to message field names
35  to set specific fields.
36  """
37  if args or kwds:
38  super(Application, self).__init__(*args, **kwds)
39  #message fields cannot be None, assign default values for those that are
40  if self.taskid is None:
41  self.taskid = ''
42  if self.name is None:
43  self.name = ''
44  if self.status is None:
45  self.status = ''
46  if self.icon is None:
47  self.icon = ''
48  if self.provides is None:
49  self.provides = ''
50  if self.depends is None:
51  self.depends = ''
52  else:
53  self.taskid = ''
54  self.name = ''
55  self.status = ''
56  self.icon = ''
57  self.provides = ''
58  self.depends = ''
59 
60  def _get_types(self):
61  """
62  internal API method
63  """
64  return self._slot_types
65 
66  def serialize(self, buff):
67  """
68  serialize message into buffer
69  :param buff: buffer, ``StringIO``
70  """
71  try:
72  _x = self.taskid
73  length = len(_x)
74  if python3 or type(_x) == unicode:
75  _x = _x.encode('utf-8')
76  length = len(_x)
77  buff.write(struct.pack('<I%ss'%length, length, _x))
78  _x = self.name
79  length = len(_x)
80  if python3 or type(_x) == unicode:
81  _x = _x.encode('utf-8')
82  length = len(_x)
83  buff.write(struct.pack('<I%ss'%length, length, _x))
84  _x = self.status
85  length = len(_x)
86  if python3 or type(_x) == unicode:
87  _x = _x.encode('utf-8')
88  length = len(_x)
89  buff.write(struct.pack('<I%ss'%length, length, _x))
90  _x = self.icon
91  length = len(_x)
92  if python3 or type(_x) == unicode:
93  _x = _x.encode('utf-8')
94  length = len(_x)
95  buff.write(struct.pack('<I%ss'%length, length, _x))
96  _x = self.provides
97  length = len(_x)
98  if python3 or type(_x) == unicode:
99  _x = _x.encode('utf-8')
100  length = len(_x)
101  buff.write(struct.pack('<I%ss'%length, length, _x))
102  _x = self.depends
103  length = len(_x)
104  if python3 or type(_x) == unicode:
105  _x = _x.encode('utf-8')
106  length = len(_x)
107  buff.write(struct.pack('<I%ss'%length, length, _x))
108  except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
109  except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
110 
111  def deserialize(self, str):
112  """
113  unpack serialized message in str into this message instance
114  :param str: byte array of serialized message, ``str``
115  """
116  try:
117  end = 0
118  start = end
119  end += 4
120  (length,) = _struct_I.unpack(str[start:end])
121  start = end
122  end += length
123  if python3:
124  self.taskid = str[start:end].decode('utf-8')
125  else:
126  self.taskid = str[start:end]
127  start = end
128  end += 4
129  (length,) = _struct_I.unpack(str[start:end])
130  start = end
131  end += length
132  if python3:
133  self.name = str[start:end].decode('utf-8')
134  else:
135  self.name = str[start:end]
136  start = end
137  end += 4
138  (length,) = _struct_I.unpack(str[start:end])
139  start = end
140  end += length
141  if python3:
142  self.status = str[start:end].decode('utf-8')
143  else:
144  self.status = str[start:end]
145  start = end
146  end += 4
147  (length,) = _struct_I.unpack(str[start:end])
148  start = end
149  end += length
150  if python3:
151  self.icon = str[start:end].decode('utf-8')
152  else:
153  self.icon = str[start:end]
154  start = end
155  end += 4
156  (length,) = _struct_I.unpack(str[start:end])
157  start = end
158  end += length
159  if python3:
160  self.provides = str[start:end].decode('utf-8')
161  else:
162  self.provides = str[start:end]
163  start = end
164  end += 4
165  (length,) = _struct_I.unpack(str[start:end])
166  start = end
167  end += length
168  if python3:
169  self.depends = str[start:end].decode('utf-8')
170  else:
171  self.depends = str[start:end]
172  return self
173  except struct.error as e:
174  raise genpy.DeserializationError(e) #most likely buffer underfill
175 
176 
177  def serialize_numpy(self, buff, numpy):
178  """
179  serialize message with numpy array types into buffer
180  :param buff: buffer, ``StringIO``
181  :param numpy: numpy python module
182  """
183  try:
184  _x = self.taskid
185  length = len(_x)
186  if python3 or type(_x) == unicode:
187  _x = _x.encode('utf-8')
188  length = len(_x)
189  buff.write(struct.pack('<I%ss'%length, length, _x))
190  _x = self.name
191  length = len(_x)
192  if python3 or type(_x) == unicode:
193  _x = _x.encode('utf-8')
194  length = len(_x)
195  buff.write(struct.pack('<I%ss'%length, length, _x))
196  _x = self.status
197  length = len(_x)
198  if python3 or type(_x) == unicode:
199  _x = _x.encode('utf-8')
200  length = len(_x)
201  buff.write(struct.pack('<I%ss'%length, length, _x))
202  _x = self.icon
203  length = len(_x)
204  if python3 or type(_x) == unicode:
205  _x = _x.encode('utf-8')
206  length = len(_x)
207  buff.write(struct.pack('<I%ss'%length, length, _x))
208  _x = self.provides
209  length = len(_x)
210  if python3 or type(_x) == unicode:
211  _x = _x.encode('utf-8')
212  length = len(_x)
213  buff.write(struct.pack('<I%ss'%length, length, _x))
214  _x = self.depends
215  length = len(_x)
216  if python3 or type(_x) == unicode:
217  _x = _x.encode('utf-8')
218  length = len(_x)
219  buff.write(struct.pack('<I%ss'%length, length, _x))
220  except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
221  except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
222 
223  def deserialize_numpy(self, str, numpy):
224  """
225  unpack serialized message in str into this message instance using numpy for array types
226  :param str: byte array of serialized message, ``str``
227  :param numpy: numpy python module
228  """
229  try:
230  end = 0
231  start = end
232  end += 4
233  (length,) = _struct_I.unpack(str[start:end])
234  start = end
235  end += length
236  if python3:
237  self.taskid = str[start:end].decode('utf-8')
238  else:
239  self.taskid = str[start:end]
240  start = end
241  end += 4
242  (length,) = _struct_I.unpack(str[start:end])
243  start = end
244  end += length
245  if python3:
246  self.name = str[start:end].decode('utf-8')
247  else:
248  self.name = str[start:end]
249  start = end
250  end += 4
251  (length,) = _struct_I.unpack(str[start:end])
252  start = end
253  end += length
254  if python3:
255  self.status = str[start:end].decode('utf-8')
256  else:
257  self.status = str[start:end]
258  start = end
259  end += 4
260  (length,) = _struct_I.unpack(str[start:end])
261  start = end
262  end += length
263  if python3:
264  self.icon = str[start:end].decode('utf-8')
265  else:
266  self.icon = str[start:end]
267  start = end
268  end += 4
269  (length,) = _struct_I.unpack(str[start:end])
270  start = end
271  end += length
272  if python3:
273  self.provides = str[start:end].decode('utf-8')
274  else:
275  self.provides = str[start:end]
276  start = end
277  end += 4
278  (length,) = _struct_I.unpack(str[start:end])
279  start = end
280  end += length
281  if python3:
282  self.depends = str[start:end].decode('utf-8')
283  else:
284  self.depends = str[start:end]
285  return self
286  except struct.error as e:
287  raise genpy.DeserializationError(e) #most likely buffer underfill
288 
289 _struct_I = genpy.struct_I
def deserialize_numpy(self, str, numpy)
def serialize_numpy(self, buff, numpy)


launchman
Author(s): Scott Noob Hassan
autogenerated on Mon Jun 10 2019 15:51:09