Back to index

plone3  3.1.7
Classes | Functions | Variables
MimetypesRegistry.MimeTypeItem Namespace Reference

Classes

class  MimeTypeItem

Functions

def guess_icon_path

Variables

tuple ICONS_DIR = os.path.join(os.path.dirname(__file__), 'skins', 'mimetypes_icons')

Function Documentation

def MimetypesRegistry.MimeTypeItem.guess_icon_path (   mimetype,
  icons_dir = ICONS_DIR,
  icon_ext = 'png' 
)

Definition at line 109 of file MimeTypeItem.py.

00109 
00110 def guess_icon_path(mimetype, icons_dir=ICONS_DIR, icon_ext='png'):
00111     if mimetype.extensions:
00112         for ext in mimetype.extensions:
00113             icon_path = '%s.%s' % (ext, icon_ext)
00114             if os.path.exists(os.path.join(icons_dir, icon_path)):
00115                 return icon_path
00116     icon_path = '%s.png' % mimetype.major()
00117     if os.path.exists(os.path.join(icons_dir, icon_path)):
00118         return icon_path
00119     return 'unknown.png'

Here is the caller graph for this function:


Variable Documentation

tuple MimetypesRegistry.MimeTypeItem.ICONS_DIR = os.path.join(os.path.dirname(__file__), 'skins', 'mimetypes_icons')

Definition at line 107 of file MimeTypeItem.py.