_StartTask.py
Go to the documentation of this file.
1 """autogenerated by genpy from launchman/StartTaskRequest.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 StartTaskRequest(genpy.Message):
9  _md5sum = "f90254a4a4912432fb92a8e890bdfbcd"
10  _type = "launchman/StartTaskRequest"
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(StartTaskRequest, 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/StartTaskResponse.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 StartTaskResponse(genpy.Message):
162  _md5sum = "4fe5af303955c287688e7347e9b00278"
163  _type = "launchman/StartTaskResponse"
164  _has_header = False #flag to mark the presence of a Header object
165  _full_text = """string status
166 
167 
168 """
169  __slots__ = ['status']
170  _slot_types = ['string']
171 
172  def __init__(self, *args, **kwds):
173  """
174  Constructor. Any message fields that are implicitly/explicitly
175  set to None will be assigned a default value. The recommend
176  use is keyword arguments as this is more robust to future message
177  changes. You cannot mix in-order arguments and keyword arguments.
178 
179  The available fields are:
180  status
181 
182  :param args: complete set of field values, in .msg order
183  :param kwds: use keyword arguments corresponding to message field names
184  to set specific fields.
185  """
186  if args or kwds:
187  super(StartTaskResponse, self).__init__(*args, **kwds)
188  #message fields cannot be None, assign default values for those that are
189  if self.status is None:
190  self.status = ''
191  else:
192  self.status = ''
193 
194  def _get_types(self):
195  """
196  internal API method
197  """
198  return self._slot_types
199 
200  def serialize(self, buff):
201  """
202  serialize message into buffer
203  :param buff: buffer, ``StringIO``
204  """
205  try:
206  _x = self.status
207  length = len(_x)
208  if python3 or type(_x) == unicode:
209  _x = _x.encode('utf-8')
210  length = len(_x)
211  buff.write(struct.pack('<I%ss'%length, length, _x))
212  except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
213  except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
214 
215  def deserialize(self, str):
216  """
217  unpack serialized message in str into this message instance
218  :param str: byte array of serialized message, ``str``
219  """
220  try:
221  end = 0
222  start = end
223  end += 4
224  (length,) = _struct_I.unpack(str[start:end])
225  start = end
226  end += length
227  if python3:
228  self.status = str[start:end].decode('utf-8')
229  else:
230  self.status = str[start:end]
231  return self
232  except struct.error as e:
233  raise genpy.DeserializationError(e) #most likely buffer underfill
234 
235 
236  def serialize_numpy(self, buff, numpy):
237  """
238  serialize message with numpy array types into buffer
239  :param buff: buffer, ``StringIO``
240  :param numpy: numpy python module
241  """
242  try:
243  _x = self.status
244  length = len(_x)
245  if python3 or type(_x) == unicode:
246  _x = _x.encode('utf-8')
247  length = len(_x)
248  buff.write(struct.pack('<I%ss'%length, length, _x))
249  except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
250  except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
251 
252  def deserialize_numpy(self, str, numpy):
253  """
254  unpack serialized message in str into this message instance using numpy for array types
255  :param str: byte array of serialized message, ``str``
256  :param numpy: numpy python module
257  """
258  try:
259  end = 0
260  start = end
261  end += 4
262  (length,) = _struct_I.unpack(str[start:end])
263  start = end
264  end += length
265  if python3:
266  self.status = str[start:end].decode('utf-8')
267  else:
268  self.status = str[start:end]
269  return self
270  except struct.error as e:
271  raise genpy.DeserializationError(e) #most likely buffer underfill
272 
273 _struct_I = genpy.struct_I
274 class StartTask(object):
275  _type = 'launchman/StartTask'
276  _md5sum = 'a7f7c2a0ff94dc94508b68c526bc0b69'
277  _request_class = StartTaskRequest
278  _response_class = StartTaskResponse
def deserialize_numpy(self, str, numpy)
Definition: _StartTask.py:123
def serialize_numpy(self, buff, numpy)
Definition: _StartTask.py:101
def serialize_numpy(self, buff, numpy)
Definition: _StartTask.py:236


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