View file File name : mimetypes.cpython-36.opt-1.pyc Content :3 \2R � @ s d Z ddlZddlZddlZddlZyddlZW n ek rH dZY nX ddddddd d ddd ddg Z dddddddddg Z dadaG dd� d�Z d6dd�Zd7dd�Zd8dd�Zd9dd �Zd:dd �Zd d� Zd!d"� Ze� ed#k�rddlZd$Zd;d&d'�Zy&ejejd(d� d)d*d+d,g�\ZZW n0 ejk �rR Z zed(e� W Y ddZ[X nX d(ZdZxDeD ]<\Z Z!e d<k�r~ed� ne d=k�r�dZne d>k�rbd(Z�qbW xheD ]`Z"e�r�ee"e�Z#e#�s�e$d3e"� ne$e#� n.ee"e�\Z#Z%e#�s�e$d3e"� ne$d4e#d5e%� �q�W dS )?a� Guess the MIME type of a file. This module defines two useful functions: guess_type(url, strict=True) -- guess the MIME type and encoding of a URL. guess_extension(type, strict=True) -- guess the extension for a given MIME type. It also contains the following, for tuning the behavior: Data: knownfiles -- list of files to parse inited -- flag set when init() has been called suffix_map -- dictionary mapping suffixes to suffixes encodings_map -- dictionary mapping suffixes to encodings types_map -- dictionary mapping suffixes to types Functions: init([files]) -- parse a list of files, default knownfiles (on Windows, the default values are taken from the registry) read_mime_types(file) -- parse one file, return a dictionary or None � N� knownfiles�inited� MimeTypes� guess_type�guess_all_extensions�guess_extension�add_type�init�read_mime_types� suffix_map� encodings_map� types_map�common_typesz/etc/mime.typesz/etc/httpd/mime.typesz/etc/httpd/conf/mime.typesz/etc/apache/mime.typesz/etc/apache2/mime.typesz$/usr/local/etc/httpd/conf/mime.typesz"/usr/local/lib/netscape/mime.typesz/usr/local/etc/mime.typesFc @ sd e Zd ZdZf dfdd�Zddd�Zddd�Zdd d �Zddd�Zdd d�Z ddd�Z ddd�ZdS )r z�MIME-types datastore. This datastore can handle information from mime.types-style files and supports basic determination of MIME type from a filename or URL, and can guess a reasonable extension given a MIME type. Tc C s� t s t� tj� | _tj� | _i i f| _i i f| _x"tj� D ]\}}| j||d� q<W x"t j� D ]\}}| j||d� q`W x|D ]}| j ||� q�W d S )NTF)r r r �copyr r � types_map_inv�itemsr r �read)�self� filenames�strict�ext�type�name� r �!/usr/lib64/python3.6/mimetypes.py�__init__B s zMimeTypes.__init__c C s6 || j | |<