Back to index

plone3  3.1.7
lookupMime.py
Go to the documentation of this file.
00001 ## Script (Python) "lookupMime"
00002 ##title=Given an id, return the human representation of mime-type.
00003 ##bind container=container
00004 ##bind context=context
00005 ##bind namespace=
00006 ##bind script=script
00007 ##bind subpath=traverse_subpath
00008 ##parameters=name
00009 
00010 mimetool = context.mimetypes_registry
00011 mimetypes = mimetool.lookup(name)
00012 if len(mimetypes):
00013     return mimetypes[0].name()
00014 else:
00015     return name