1. pombredanne
  2. CherryPy


Robert Brewer  committed ee8b18f

Made the class used for multipart parts configurable.

  • Participants
  • Parent commits ca94720
  • Branches default

Comments (0)

Files changed (1)

File cherrypy/_cpreqbody.py

View file
  • Ignore whitespace
     # Read all parts
     while True:
-        part = Part.from_fp(entity.fp, ib)
+        part = entity.part_class.from_fp(entity.fp, ib)
         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
         return fp_out
+Entity.part_class = Part
 class Infinity(object):
     def __cmp__(self, other):