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

def PortalTransforms::MimeTypesRegistry::MimeTypesRegistry::lookup (   self,
  mimetypestring 
)

Lookup for imimetypes object matching mimetypestring

mimetypestring may have an empty minor part or containing a
wildcard (*) mimetypestring may and imimetype object (in this
case it will be returned unchanged

Return a list of mimetypes objects associated with the
RFC-2046 name return an empty list if no one is known.

Definition at line 123 of file MimeTypesRegistry.py.

00123                                     :
        """Lookup for imimetypes object matching mimetypestring

        mimetypestring may have an empty minor part or containing a
        wildcard (*) mimetypestring may and imimetype object (in this
        case it will be returned unchanged

        Return a list of mimetypes objects associated with the
        RFC-2046 name return an empty list if no one is known.
        """
        if implements(mimetypestring, imimetype):
            return (mimetypestring, )
        __traceback_info__ = (repr(mimetypestring), str(mimetypestring))
        major, minor = split(str(mimetypestring))
        group = self._mimetypes.get(major, {})
        if not minor or minor == '*':
            v = group.values()
        else:
            v = group.get(minor)
            if v:
                v = (v,)
            else:
                return ()
        return v

    def lookupExtension(self, filename):


Generated by  Doxygen 1.6.0   Back to index