Back to index

plone3  3.1.7
Functions | Variables
MimetypesRegistry.mime_types.suppl_mimetypes Namespace Reference

Functions

def initialize

Variables

dictionary map

Function Documentation

Definition at line 12 of file suppl_mimetypes.py.

00012 
00013 def initialize(registry):
00014     #Find things that are not in the specially registered mimetypes
00015     #and add them using some default policy, none of these will impl
00016     #iclassifier
00017     for ext, mt in map.items():
00018         if ext[0] == '.':
00019             ext = ext[1:]
00020         
00021         if registry.lookupExtension(ext):
00022             continue
00023 
00024         try:
00025             mto =  registry.lookup(mt)
00026         except MimeTypeException:
00027             # malformed MIME type
00028             continue
00029         if mto:
00030             mto = mto[0]
00031             if not ext in mto.extensions:
00032                 registry.register_extension(ext, mto)
00033                 mto.extensions += (ext, )
00034             continue
00035         isBin = mt.split('/', 1)[0] != "text"
00036         registry.register(MimeTypeItem(mt, (mt,), (ext,), isBin))

Variable Documentation

Initial value:
00001 {
00002     # '.extension' : 'mimetype',
00003     '.svg' : 'image/svg+xml', # scaleable vector graphics
00004     '.pjpg' : 'image/pjpeg', # scaleable vector graphics
00005     
00006 }

Definition at line 5 of file suppl_mimetypes.py.