def iter_multipart_mime_documents(wsgi_input, boundary, read_chunk_size=4096):
 boundary = ('--' + boundary)
 blen = (len(boundary) + 2)
 try:
  got = wsgi_input.readline(blen)
  while (got == '\r\n'):
   got = wsgi_input.readline(blen)
 except (IOError, ValueError) as e:
  raise swift.common.exceptions.ChunkReadError(str(e))
 if (got.strip() != boundary):
  raise swift.common.exceptions.MimeInvalid('invalid starting boundary: wanted %r, got %r', (boundary, got))
 boundary = ('\r\n' + boundary)
 input_buffer = ''
 done = False
 while (not done):
  it = _MultipartMimeFileLikeObject(wsgi_input, boundary, input_buffer, read_chunk_size)
  (yield it)
  done = it.no_more_files
  input_buffer = it.input_buffer

def iter_multipart_mime_documents ( wsgi_input , boundary , read_chunk_size = 4096 ) : boundary = ( '--' + boundary ) blen = ( len ( boundary ) + 2 ) try : got = wsgi_input . readline ( blen ) while ( got == '\r\n' ) : got = wsgi_input . readline ( blen ) except ( IOError , ValueError ) as e : raise swift . common . exceptions . ChunkReadError ( str ( e ) ) if ( got . strip ( ) != boundary ) : raise swift . common . exceptions . MimeInvalid ( 'invalid starting boundary: wanted %r, got %r' , ( boundary , got ) ) boundary = ( '\r\n' + boundary ) input_buffer = '' done = False while ( not done ) : it = _MultipartMimeFileLikeObject ( wsgi_input , boundary , input_buffer , read_chunk_size ) ( yield it ) done = it . no_more_files input_buffer = it . input_buffer
given a multi-part-mime-encoded input file object and boundary .