Go to the documentation of this file.00001 """autogenerated by genpy from shell_execution_action_server/ShellCommandFeedback.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006
00007
00008 class ShellCommandFeedback(genpy.Message):
00009 _md5sum = "a22ca6049eac43619a80a5c2ca6804ed"
00010 _type = "shell_execution_action_server/ShellCommandFeedback"
00011 _has_header = False
00012 _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00013 #Feedback (current output)
00014 string stdout
00015 string stderr
00016
00017
00018 """
00019 __slots__ = ['stdout','stderr']
00020 _slot_types = ['string','string']
00021
00022 def __init__(self, *args, **kwds):
00023 """
00024 Constructor. Any message fields that are implicitly/explicitly
00025 set to None will be assigned a default value. The recommend
00026 use is keyword arguments as this is more robust to future message
00027 changes. You cannot mix in-order arguments and keyword arguments.
00028
00029 The available fields are:
00030 stdout,stderr
00031
00032 :param args: complete set of field values, in .msg order
00033 :param kwds: use keyword arguments corresponding to message field names
00034 to set specific fields.
00035 """
00036 if args or kwds:
00037 super(ShellCommandFeedback, self).__init__(*args, **kwds)
00038
00039 if self.stdout is None:
00040 self.stdout = ''
00041 if self.stderr is None:
00042 self.stderr = ''
00043 else:
00044 self.stdout = ''
00045 self.stderr = ''
00046
00047 def _get_types(self):
00048 """
00049 internal API method
00050 """
00051 return self._slot_types
00052
00053 def serialize(self, buff):
00054 """
00055 serialize message into buffer
00056 :param buff: buffer, ``StringIO``
00057 """
00058 try:
00059 _x = self.stdout
00060 length = len(_x)
00061 if python3 or type(_x) == unicode:
00062 _x = _x.encode('utf-8')
00063 length = len(_x)
00064 buff.write(struct.pack('<I%ss'%length, length, _x))
00065 _x = self.stderr
00066 length = len(_x)
00067 if python3 or type(_x) == unicode:
00068 _x = _x.encode('utf-8')
00069 length = len(_x)
00070 buff.write(struct.pack('<I%ss'%length, length, _x))
00071 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00072 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00073
00074 def deserialize(self, str):
00075 """
00076 unpack serialized message in str into this message instance
00077 :param str: byte array of serialized message, ``str``
00078 """
00079 try:
00080 end = 0
00081 start = end
00082 end += 4
00083 (length,) = _struct_I.unpack(str[start:end])
00084 start = end
00085 end += length
00086 if python3:
00087 self.stdout = str[start:end].decode('utf-8')
00088 else:
00089 self.stdout = str[start:end]
00090 start = end
00091 end += 4
00092 (length,) = _struct_I.unpack(str[start:end])
00093 start = end
00094 end += length
00095 if python3:
00096 self.stderr = str[start:end].decode('utf-8')
00097 else:
00098 self.stderr = str[start:end]
00099 return self
00100 except struct.error as e:
00101 raise genpy.DeserializationError(e)
00102
00103
00104 def serialize_numpy(self, buff, numpy):
00105 """
00106 serialize message with numpy array types into buffer
00107 :param buff: buffer, ``StringIO``
00108 :param numpy: numpy python module
00109 """
00110 try:
00111 _x = self.stdout
00112 length = len(_x)
00113 if python3 or type(_x) == unicode:
00114 _x = _x.encode('utf-8')
00115 length = len(_x)
00116 buff.write(struct.pack('<I%ss'%length, length, _x))
00117 _x = self.stderr
00118 length = len(_x)
00119 if python3 or type(_x) == unicode:
00120 _x = _x.encode('utf-8')
00121 length = len(_x)
00122 buff.write(struct.pack('<I%ss'%length, length, _x))
00123 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00124 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00125
00126 def deserialize_numpy(self, str, numpy):
00127 """
00128 unpack serialized message in str into this message instance using numpy for array types
00129 :param str: byte array of serialized message, ``str``
00130 :param numpy: numpy python module
00131 """
00132 try:
00133 end = 0
00134 start = end
00135 end += 4
00136 (length,) = _struct_I.unpack(str[start:end])
00137 start = end
00138 end += length
00139 if python3:
00140 self.stdout = str[start:end].decode('utf-8')
00141 else:
00142 self.stdout = str[start:end]
00143 start = end
00144 end += 4
00145 (length,) = _struct_I.unpack(str[start:end])
00146 start = end
00147 end += length
00148 if python3:
00149 self.stderr = str[start:end].decode('utf-8')
00150 else:
00151 self.stderr = str[start:end]
00152 return self
00153 except struct.error as e:
00154 raise genpy.DeserializationError(e)
00155
00156 _struct_I = genpy.struct_I