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

def PortalTransforms::MimeTypesRegistry::MimeTypesRegistry::register (   self,
  mimetype 
)

Register a new mimetype

mimetype must implement imimetype

Definition at line 61 of file MimeTypesRegistry.py.

00061                                 :
        """ Register a new mimetype

        mimetype must implement imimetype
        """
        mimetype = aq_base(mimetype)
        assert implements(mimetype, imimetype)
        for t in mimetype.mimetypes:
            major, minor = split(t)
            if not major or not minor or minor == '*':
                raise MimeTypeException('Can\'t register mime type %s' % t)
            group = self._mimetypes.setdefault(major, DictClass())
            if group.has_key(minor):
                log('Warning: redefining mime type %s (%s)' % (t, mimetype.__class__))
            group[minor] = mimetype
        for extension in mimetype.extensions:
            self.register_extension(extension, mimetype)

    def register_extension(self, extension, mimetype):


Generated by  Doxygen 1.6.0   Back to index