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


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