Commits

Robert Brewer committed ee8b18f

Made the class used for multipart parts configurable.

Comments (0)

Files changed (1)

cherrypy/_cpreqbody.py

     
     # Read all parts
     while True:
-        part = Part.from_fp(entity.fp, ib)
+        part = entity.part_class.from_fp(entity.fp, ib)
         entity.parts.append(part)
         part.process()
         if part.fp.done:
     def __init__(self, fp, headers, params=None, parts=None):
         # Make an instance-specific copy of the class processors
         # so Tools, etc. can replace them per-request.
-        # TODO: that makes it easy for request.body but not Parts. Fix.
         self.processors = self.processors.copy()
         
         self.fp = fp
         self.read_lines_to_boundary(fp_out=fp_out)
         return fp_out
 
+Entity.part_class = Part
+
 
 class Infinity(object):
     def __cmp__(self, other):