_AppUpdate.py
Go to the documentation of this file.
1 """autogenerated by genpy from launchman/AppUpdate.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 genpy
8 import std_msgs.msg
9 
10 class AppUpdate(genpy.Message):
11  _md5sum = "5798525d2dcbad786f5d5d2c3dfd0cae"
12  _type = "launchman/AppUpdate"
13  _has_header = True #flag to mark the presence of a Header object
14  _full_text = """Header header
15 string taskid
16 string username
17 string status
18 time started
19 
20 ================================================================================
21 MSG: std_msgs/Header
22 # Standard metadata for higher-level stamped data types.
23 # This is generally used to communicate timestamped data
24 # in a particular coordinate frame.
25 #
26 # sequence ID: consecutively increasing ID
27 uint32 seq
28 #Two-integer timestamp that is expressed as:
29 # * stamp.secs: seconds (stamp_secs) since epoch
30 # * stamp.nsecs: nanoseconds since stamp_secs
31 # time-handling sugar is provided by the client library
32 time stamp
33 #Frame this data is associated with
34 # 0: no frame
35 # 1: global frame
36 string frame_id
37 
38 """
39  __slots__ = ['header','taskid','username','status','started']
40  _slot_types = ['std_msgs/Header','string','string','string','time']
41 
42  def __init__(self, *args, **kwds):
43  """
44  Constructor. Any message fields that are implicitly/explicitly
45  set to None will be assigned a default value. The recommend
46  use is keyword arguments as this is more robust to future message
47  changes. You cannot mix in-order arguments and keyword arguments.
48 
49  The available fields are:
50  header,taskid,username,status,started
51 
52  :param args: complete set of field values, in .msg order
53  :param kwds: use keyword arguments corresponding to message field names
54  to set specific fields.
55  """
56  if args or kwds:
57  super(AppUpdate, self).__init__(*args, **kwds)
58  #message fields cannot be None, assign default values for those that are
59  if self.header is None:
60  self.header = std_msgs.msg.Header()
61  if self.taskid is None:
62  self.taskid = ''
63  if self.username is None:
64  self.username = ''
65  if self.status is None:
66  self.status = ''
67  if self.started is None:
68  self.started = genpy.Time()
69  else:
70  self.header = std_msgs.msg.Header()
71  self.taskid = ''
72  self.username = ''
73  self.status = ''
74  self.started = genpy.Time()
75 
76  def _get_types(self):
77  """
78  internal API method
79  """
80  return self._slot_types
81 
82  def serialize(self, buff):
83  """
84  serialize message into buffer
85  :param buff: buffer, ``StringIO``
86  """
87  try:
88  _x = self
89  buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
90  _x = self.header.frame_id
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.taskid
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.username
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  _x = self.status
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
115  buff.write(_struct_2I.pack(_x.started.secs, _x.started.nsecs))
116  except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
117  except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
118 
119  def deserialize(self, str):
120  """
121  unpack serialized message in str into this message instance
122  :param str: byte array of serialized message, ``str``
123  """
124  try:
125  if self.header is None:
126  self.header = std_msgs.msg.Header()
127  if self.started is None:
128  self.started = genpy.Time()
129  end = 0
130  _x = self
131  start = end
132  end += 12
133  (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
134  start = end
135  end += 4
136  (length,) = _struct_I.unpack(str[start:end])
137  start = end
138  end += length
139  if python3:
140  self.header.frame_id = str[start:end].decode('utf-8')
141  else:
142  self.header.frame_id = str[start:end]
143  start = end
144  end += 4
145  (length,) = _struct_I.unpack(str[start:end])
146  start = end
147  end += length
148  if python3:
149  self.taskid = str[start:end].decode('utf-8')
150  else:
151  self.taskid = str[start:end]
152  start = end
153  end += 4
154  (length,) = _struct_I.unpack(str[start:end])
155  start = end
156  end += length
157  if python3:
158  self.username = str[start:end].decode('utf-8')
159  else:
160  self.username = str[start:end]
161  start = end
162  end += 4
163  (length,) = _struct_I.unpack(str[start:end])
164  start = end
165  end += length
166  if python3:
167  self.status = str[start:end].decode('utf-8')
168  else:
169  self.status = str[start:end]
170  _x = self
171  start = end
172  end += 8
173  (_x.started.secs, _x.started.nsecs,) = _struct_2I.unpack(str[start:end])
174  self.started.canon()
175  return self
176  except struct.error as e:
177  raise genpy.DeserializationError(e) #most likely buffer underfill
178 
179 
180  def serialize_numpy(self, buff, numpy):
181  """
182  serialize message with numpy array types into buffer
183  :param buff: buffer, ``StringIO``
184  :param numpy: numpy python module
185  """
186  try:
187  _x = self
188  buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
189  _x = self.header.frame_id
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 = self.taskid
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 = self.username
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 = self.status
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 = self
214  buff.write(_struct_2I.pack(_x.started.secs, _x.started.nsecs))
215  except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
216  except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
217 
218  def deserialize_numpy(self, str, numpy):
219  """
220  unpack serialized message in str into this message instance using numpy for array types
221  :param str: byte array of serialized message, ``str``
222  :param numpy: numpy python module
223  """
224  try:
225  if self.header is None:
226  self.header = std_msgs.msg.Header()
227  if self.started is None:
228  self.started = genpy.Time()
229  end = 0
230  _x = self
231  start = end
232  end += 12
233  (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
234  start = end
235  end += 4
236  (length,) = _struct_I.unpack(str[start:end])
237  start = end
238  end += length
239  if python3:
240  self.header.frame_id = str[start:end].decode('utf-8')
241  else:
242  self.header.frame_id = str[start:end]
243  start = end
244  end += 4
245  (length,) = _struct_I.unpack(str[start:end])
246  start = end
247  end += length
248  if python3:
249  self.taskid = str[start:end].decode('utf-8')
250  else:
251  self.taskid = str[start:end]
252  start = end
253  end += 4
254  (length,) = _struct_I.unpack(str[start:end])
255  start = end
256  end += length
257  if python3:
258  self.username = str[start:end].decode('utf-8')
259  else:
260  self.username = str[start:end]
261  start = end
262  end += 4
263  (length,) = _struct_I.unpack(str[start:end])
264  start = end
265  end += length
266  if python3:
267  self.status = str[start:end].decode('utf-8')
268  else:
269  self.status = str[start:end]
270  _x = self
271  start = end
272  end += 8
273  (_x.started.secs, _x.started.nsecs,) = _struct_2I.unpack(str[start:end])
274  self.started.canon()
275  return self
276  except struct.error as e:
277  raise genpy.DeserializationError(e) #most likely buffer underfill
278 
279 _struct_I = genpy.struct_I
280 _struct_3I = struct.Struct("<3I")
281 _struct_2I = struct.Struct("<2I")
def __init__(self, args, kwds)
Definition: _AppUpdate.py:42
def serialize_numpy(self, buff, numpy)
Definition: _AppUpdate.py:180
def deserialize_numpy(self, str, numpy)
Definition: _AppUpdate.py:218


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