a �DOg�s  zMimeTypes.readfpc Cs�tsdSdd�}t�tjd���}||�D]�}z�t�||��b}|�d�sVWd�Wq(t�|d�\}}|tjkr�Wd�Wq(|�|||�Wd�n1s�0YWq(ty�Yq(Yq(0q(Wd�n1s�0YdS)NcssHd}zt�||�}Wnty*YqDYn0d|vr:|V|d7}qdS)Nr�rB)�_winregZEnumKey�OSError)ZmimedbrJZctyperrr � enum_types�s  z3MimeTypes.read_windows_registry..enum_types�rCz Content Type)rM�OpenKeyZHKEY_CLASSES_ROOT� startswithZ QueryValueExZREG_SZrrN)rrrOZhkcrZ subkeynameZsubkeyZmimetypeZdatatyperrr �read_windows_registry�s"    � 0 zMimeTypes.read_windows_registryN)rT)T)T)T)T)T)T)T) �__name__� __module__� __qualname__r!rrrrrr>rSrrrr r:s   =   rTcCstdurt�t�||�Sr")�_dbr r)r4rrrr rsrcCstdurt�t�||�Sr")rWr r�rrrrr r%s rcCstdurt�t�||�Sr")rWr rrXrrr r6s rcCstdurt�t�|||�Sr")rWr r)rrrrrr rFs rcCs�da|dustdurBt�}tr&|��|dur4t}qFtt|�}nt}|D]}tj� |�rJ|� |�qJ|j a |j a |j da |j da|adSr)rrWrrMrSrr8r+�path�isfilerr r r r)�files�db�filerrr r Ws"    r cCsjzt|dd�}Wnty$YdS0|�,t�}|�|d�|jdWd�S1s\0YdS)Nr;r<T)r=rNrr>r )r]�fr\rrr r ss  r c�CsXddddddd�aadddd d d �aad d d ddddddddddddddddddddddddddddddddddd d!d!d"d"d#d$d$d%d&d'd(d)d*d+d,d-d-d.d.d.d/d0d1d2d3d4d4d4d4d5d6d6d7d7d8d8d8d9d:d;dd>d>d?d@dAdAdBdCdDdEdFdGdHdIdJdKdLdMdMdMdMdNdOdPdPdQdQdQdQdQdQdRdSdTdUdVdVdWdXdYdZdZdZdZdZd[d[d\d]d^d_��aad`dadadbdcdcdcddde�aadS)fNz.svg.gzz.tar.gzz.tar.bz2z.tar.xz)z.svgzz.tgzz.tazz.tzz.tbz2z.txz�gzip�compress�bzip2�xz�br)z.gzz.Zz.bz2z.xzz.brzapplication/javascriptzapplication/jsonzapplication/manifest+jsonzapplication/mswordzapplication/octet-streamzapplication/odazapplication/pdfzapplication/pkcs7-mimezapplication/postscriptzapplication/vnd.apple.mpegurlzapplication/vnd.ms-excelzapplication/vnd.ms-powerpointzapplication/wasmzapplication/x-bcpiozapplication/x-cpiozapplication/x-cshzapplication/x-dvizapplication/x-gtarzapplication/x-hdfzapplication/x-latexzapplication/x-mifzapplication/x-netcdfzapplication/x-pkcs12zapplication/x-pn-realaudiozapplication/x-python-codezapplication/x-shzapplication/x-sharzapplication/x-shockwave-flashzapplication/x-sv4cpiozapplication/x-sv4crczapplication/x-tarzapplication/x-tclzapplication/x-texzapplication/x-texinfozapplication/x-troffzapplication/x-troff-manzapplication/x-troff-mezapplication/x-troff-mszapplication/x-ustarzapplication/x-wais-sourcezapplication/xmlzapplication/zipz audio/basicz audio/mpegz audio/x-aiffzaudio/x-pn-realaudioz audio/x-wavz image/bmpz image/gifz image/iefz image/jpegz image/pngz image/svg+xmlz image/tiffzimage/vnd.microsoft.iconzimage/x-cmu-rasterzimage/x-ms-bmpzimage/x-portable-anymapzimage/x-portable-bitmapzimage/x-portable-graymapzimage/x-portable-pixmapz image/x-rgbzimage/x-xbitmapzimage/x-xpixmapzimage/x-xwindowdumpzmessage/rfc822ztext/cssztext/csvz text/htmlr*z text/richtextztext/tab-separated-valuesz text/x-pythonz text/x-setextz text/x-sgmlz text/x-vcardztext/xmlz video/mp4z video/mpegzvideo/quicktimez video/webmzvideo/x-msvideozvideo/x-sgi-movie)�z.jsz.mjsz.jsonz .webmanifestz.docz.dotz.wizz.binz.az.dllz.exez.oz.objz.soz.odaz.pdfz.p7cz.psz.aiz.epsz.m3uz.m3u8z.xlsz.xlbz.pptz.potz.ppaz.ppsz.pwzz.wasmz.bcpioz.cpioz.cshz.dviz.gtarz.hdfz.latexz.mifz.cdfz.ncz.p12z.pfxz.ramz.pycz.pyoz.shz.sharz.swfz.sv4cpioz.sv4crcz.tarz.tclz.texz.texiz.texinfoz.roffz.tz.trz.manz.mez.msz.ustarz.srcz.xslz.rdfz.wsdlz.xpdlz.zipz.auz.sndz.mp3z.mp2z.aifz.aifcz.aiffz.raz.wav�.bmpz.gifz.ief�.jpgz.jpez.jpegz.pngz.svgz.tiffz.tifz.icoz.rasrdz.pnmz.pbmz.pgmz.ppmz.rgbz.xbmz.xpmz.xwdz.emlz.mhtz.mhtmlz.nwsz.cssz.csvz.htmlz.htmz.txtz.batz.cz.hz.kshz.plz.rtxz.tsvz.pyz.etxz.sgmz.sgmlz.vcfz.xmlz.mp4z.mpegz.m1vz.mpaz.mpez.mpgz.movz.qtz.webmz.aviz.moviezapplication/rtfz audio/midiz image/jpgz image/pictztext/xul)z.rtfz.midiz.midrez.pictz.pctz.picz.xul)r rr rr rrrrrrr �_default_mime_types~s8� � ��  �rfc sddl}d�d�fdd� }z$|�tjdd�dgd��\}}Wn0|jyn}z|d|�WYd}~n d}~00d}d}|D]4\}}|d vr�|d�q||d vr�d}q||d vr|d}q||D]Z} |r�t| |�} | s�td | �nt| �q�t| |�\} } | �std | �q�td | d| �q�dS)Nra4Usage: mimetypes.py [options] type Options: --help / -h -- print this message and exit --lenient / -l -- additionally search of some common, but non-standard types. --extension / -e -- guess extension instead of type More than one type argument may be given. rPcs"t��|rt|�t�|�dSr")�print�sys�exit)�code�msg�ZUSAGErr �usageDs z_main..usagerBZhle)�helpZlenient� extension)z-hz--help)z-lz --lenient)z-ez --extensionz I don't know anything about typeztype:z encoding:)rP)�getoptrh�argv�errorrrgr) rprmZopts�argsrkrro�opt�argZgtypeZguessr7rrlr �_main5s4 �      rv�__main__)T)T)T)T)N)r+rhr1� urllib.parser-�winregrM� ImportError�__all__rrrWrrrrrr r rfrvrTrrrr �s2    U      5.