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

def AttachmentField::PortalTransformsAttachment::PortalTransformsAttachment::_getTransformPath (   self,
  input,
  output 
) [private]

_getTransformPath(self, input, output) => chain or None
Try to build a transform chain from 'input' mime type to 'output' mime type.
If it's not possible to build such a chain, return None.
Nota: this code is taken from TransformEngine.py

Definition at line 254 of file PortalTransformsAttachment.py.

00254                                               :
        """
        _getTransformPath(self, input, output) => chain or None
        Try to build a transform chain from 'input' mime type to 'output' mime type.
        If it's not possible to build such a chain, return None.
        Nota: this code is taken from TransformEngine.py
        """
        ## get a path to output mime type
        transform = self.getPortalTransforms()
        requirements = transform._policies.get(target_mt, [])
        path = transform._findPath(orig_mt, target_mt, list(requirements))
        if not path and requirements:
            Log(LOG_DEBUG, 'Unable to satisfy requirements %s' % ', '.join(requirements), )
            path = transform._findPath(orig_mt, target_mt)
        if not path:
            Log(LOG_DEBUG, 'NO PATH FROM %s TO %s : %s' % (orig_mt, target_mimetype, path), )
            return None
        return path


AttachmentHandler.registerHandler(PortalTransformsAttachment)
AttachmentHandler.registerHandler(PortalTransformsAttachment)


Generated by  Doxygen 1.6.0   Back to index