def parse_parts(self, file, boundary, content_length):
    "Generate `('file', (name, val))` and `('form', (name\n        ,val))` parts.\n        "
    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, _decode_unicode(''.join(container), part_charset, self.errors))))
Generate `('file', (name, val))` and `('form', (name
,val))` parts.
def parse_parts(self, file, boundary, content_length):
    "Generate `('file', (name, val))` and `('form', (name\n        ,val))` parts.\n        "
    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, _decode_unicode(.join(container), part_charset, self.errors))))