'Generate ``(\'file\', (name, val))`` and
``(\'form\', (name, val))`` parts.'

def parse_parts(self, file, boundary, content_length):

    in_memory = 0
    for (ellt, ell) in self.parse_lines(file, boundary, content_length):
        if (ellt == _begin_file):
            (headers, name, filename) = ell
            is_file = True
            guard_memory = False
            (filename, container) = self.start_file_streaming(filename, headers, content_length)
            _write = container.write
        elif (ellt == _begin_form):
            (headers, name) = ell
            is_file = False
            container = []
            _write = container.append
            guard_memory = (self.max_form_memory_size is not None)
        elif (ellt == _cont):
            _write(ell)
            if guard_memory:
                in_memory += len(ell)
                if (in_memory > self.max_form_memory_size):
                    self.in_memory_threshold_reached(in_memory)
        elif (ellt == _end):
            if is_file:
                container.seek(0)
                (yield ('file', (name, FileStorage(container, filename, name, headers=headers))))
            else:
                part_charset = self.get_part_charset(headers)
                (yield ('form', (name, ''.join(container).decode(part_charset, self.errors))))
