Logo Search packages:      
Sourcecode: zope-extfile version File versions

def zope-extfile-1.4.2::ExtImage::ExtImage::PUT (   self,
  REQUEST,
  RESPONSE 
)

Handle HTTP PUT requests 

Definition at line 414 of file ExtImage.py.

00414                                     :
        """ Handle HTTP PUT requests """
        RESPONSE = ExtImage.inheritedAttribute("PUT")(self, REQUEST, RESPONSE)
        if self.has_preview:
            width, height = self._getImageSize(self.prev_filename)
            self._register()    # Register with TM
            try:
                # Need to pass in the path as webdav.NullResource calls PUT
                # on an unwrapped object.
                try:
                    self.aq_parent # This raises AttributeError if no context
                except AttributError:
                    path = self._get_zodb_path(REQUEST.PARENTS[0])
                else:
                    path = None
                new_fn = self._get_ufn(self.prev_filename, content_type='image/jpeg', path=path)
                self._createPreview(self.filename, new_fn, width, height, self.prev_ratio)
            finally: self._dir__unlock() 
        return RESPONSE
    
    ################################


Generated by  Doxygen 1.6.0   Back to index