def parse_hybi00_frames(buf):
 start = buf.find('\x00')
 tail = 0
 frames = []
 while (start != (-1)):
  end = buf.find('\xff', (start + 1))
  if (end == (-1)):
   break
  else:
   frame = buf[(start + 1):end]
   frames.append((NORMAL, frame))
   tail = (end + 1)
  start = buf.find('\x00', (end + 1))
 buf = buf[tail:]
 return (frames, buf)

def parse_hybi00_frames ( buf ) : start = buf . find ( '\x00' ) tail = 0 frames = [ ] while ( start != ( - 1 ) ) : end = buf . find ( '\xff' , ( start + 1 ) ) if ( end == ( - 1 ) ) : break else : frame = buf [ ( start + 1 ) : end ] frames . append ( ( NORMAL , frame ) ) tail = ( end + 1 ) start = buf . find ( '\x00' , ( end + 1 ) ) buf = buf [ tail : ] return ( frames , buf )
parse hybi-00 frames .