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


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