File: string_fixed_ser.txt

package info (click to toggle)
ros-genpy 0.6.18-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 588 kB
  • sloc: python: 2,830; makefile: 107; xml: 33
file content (8 lines) | stat: -rw-r--r-- 325 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
if len(data) != 2:
  self._check_types(ValueError("Expecting %s items but found %s when writing '%s'" % (2, len(data), 'data')))
for val0 in data:
  length = len(val0)
  if python3 or type(val0) == unicode:
    val0 = val0.encode('utf-8')
    length = len(val0)
  buff.write(struct.Struct('<I%ss'%length).pack(length, val0))