()
return mailcaps
Return a list of all mailcap files found on the system.
Return a list of all mailcap files found on the system.
Return a list of all mailcap files found on the system .
def listmailcapfiles():
    """Return a list of all mailcap files found on the system."""
    # This is mostly a Unix thing, but we use the OS path separator anyway
    if 'MAILCAPS' in os.environ:
        pathstr = os.environ['MAILCAPS']
        mailcaps = pathstr.split(os.pathsep)
    else:
        if 'HOME' in os.environ:
            home = os.environ['HOME']
        else:
            # Don't bother with getpwuid()
            home = '.' # Last resort
        mailcaps = [home + '/.mailcap', '/etc/mailcap',
                '/usr/etc/mailcap', '/usr/local/etc/mailcap']
    return mailcaps
def listmailcapfiles ( ) : # This is mostly a Unix thing, but we use the OS path separator anyway if 'MAILCAPS' in os . environ : pathstr = os . environ [ 'MAILCAPS' ] mailcaps = pathstr . split ( os . pathsep ) else : if 'HOME' in os . environ : home = os . environ [ 'HOME' ] else : # Don't bother with getpwuid() home = '.' # Last resort mailcaps = [ home + '/.mailcap' , '/etc/mailcap' , '/usr/etc/mailcap' , '/usr/local/etc/mailcap' ] return mailcaps