OpenQuizz
Une application de gestion des contenus pédagogiques
MultiPartParser Class Reference
Inheritance diagram for MultiPartParser:
Collaboration diagram for MultiPartParser:

Public Member Functions

def __init__ (self, stream_factory=None, charset="utf-8", errors="replace", max_form_memory_size=None, cls=None, buffer_size=64 *1024)
 
def fail (self, message)
 
def get_part_encoding (self, headers)
 
def get_part_charset (self, headers)
 
def start_file_streaming (self, filename, headers, total_content_length)
 
def in_memory_threshold_reached (self, bytes)
 
def validate_boundary (self, boundary)
 
def parse_lines (self, file, boundary, content_length, cap_at_buffer=True)
 
def parse_parts (self, file, boundary, content_length)
 
def parse (self, file, boundary, content_length)
 

Data Fields

 charset
 
 errors
 
 max_form_memory_size
 
 stream_factory
 
 cls
 
 buffer_size
 

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  stream_factory = None,
  charset = "utf-8",
  errors = "replace",
  max_form_memory_size = None,
  cls = None,
  buffer_size = 64 * 1024 
)

Member Function Documentation

◆ fail()

def fail (   self,
  message 
)

◆ get_part_charset()

def get_part_charset (   self,
  headers 
)

◆ get_part_encoding()

def get_part_encoding (   self,
  headers 
)

◆ in_memory_threshold_reached()

def in_memory_threshold_reached (   self,
  bytes 
)

◆ parse()

def parse (   self,
  file,
  boundary,
  content_length 
)

◆ parse_lines()

def parse_lines (   self,
  file,
  boundary,
  content_length,
  cap_at_buffer = True 
)
Generate parts of
``('begin_form', (headers, name))``
``('begin_file', (headers, name, filename))``
``('cont', bytestring)``
``('end', None)``

Always obeys the grammar
parts = ( begin_form cont* end |
  begin_file cont* end )*

◆ parse_parts()

def parse_parts (   self,
  file,
  boundary,
  content_length 
)
Generate ``('file', (name, val))`` and
``('form', (name, val))`` parts.

◆ start_file_streaming()

def start_file_streaming (   self,
  filename,
  headers,
  total_content_length 
)

◆ validate_boundary()

def validate_boundary (   self,
  boundary 
)

Field Documentation

◆ buffer_size

buffer_size

◆ charset

charset

◆ cls

cls

◆ errors

errors

◆ max_form_memory_size

max_form_memory_size

◆ stream_factory

stream_factory

The documentation for this class was generated from the following file: