def getcaps():
 caps = {}
 for mailcap in listmailcapfiles():
  try:
   fp = open(mailcap, 'r')
  except IOError:
   continue
  with fp:
   morecaps = readmailcapfile(fp)
  for (key, value) in morecaps.iteritems():
   if (not (key in caps)):
    caps[key] = value
   else:
    caps[key] = (caps[key] + value)
 return caps

def getcaps ( ) : caps = { } for mailcap in listmailcapfiles ( ) : try : fp = open ( mailcap , 'r' ) except IOError : continue with fp : morecaps = readmailcapfile ( fp ) for ( key , value ) in morecaps . iteritems ( ) : if ( not ( key in caps ) ) : caps [ key ] = value else : caps [ key ] = ( caps [ key ] + value ) return caps
return a dictionary containing the mailcap database .