Logo Search packages:      
Sourcecode: zope-attachmentfield version File versions  Download package

def AttachmentField::ooconverter::DynZip::__call__ (   self,
  args,
  kw 
)

return content of the zipfile emulating a container

Definition at line 414 of file ooconverter.py.

00414                                    :
        """
        return content of the zipfile emulating a container
        """
        if hasattr(self, 'REQUEST'):
            REQUEST=self.REQUEST
        else: REQUEST=None

        if self._caching and REQUEST:
            if not self.workingState() and self.hasImage(self.current):
                img = self.getImage(self.current)
                if img.getContentType().startswith('image'):
                    return img.__of__(aq_parent(self)).index_html(REQUEST, REQUEST.RESPONSE)

        body=self.read(self.current)
        fn=self.current.split('/')[-1]
        content_type, enc=guess_content_type(fn, body)

        if REQUEST:
            REQUEST.RESPONSE.setHeader('Content-Type', content_type)
            REQUEST.RESPONSE.setHeader('Content-Disposition', 'filename=%s' % (fn))
        return self.read(self.current)

    index_html=__call__


Generated by  Doxygen 1.6.0   Back to index