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):
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.