def seek_delimiter(file, delimiter, blocksize):
 if (file.tell() == 0):
  return
 last = ''
 while True:
  current = file.read(blocksize)
  if (not current):
   return
  full = (last + current)
  try:
   i = full.index(delimiter)
   file.seek(((file.tell() - (len(full) - i)) + len(delimiter)))
   return
  except ValueError:
   pass
  last = full[(- len(delimiter)):]

def seek_delimiter ( file , delimiter , blocksize ) : if ( file . tell ( ) == 0 ) : return last = '' while True : current = file . read ( blocksize ) if ( not current ) : return full = ( last + current ) try : i = full . index ( delimiter ) file . seek ( ( ( file . tell ( ) - ( len ( full ) - i ) ) + len ( delimiter ) ) ) return except ValueError : pass last = full [ ( - len ( delimiter ) ) : ]
seek current file to next byte after a delimiter bytestring this seeks the file to the next byte following the delimiter .