JFIFxxC      C  " }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3RbrJFIFxxC      C  " }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3Rbrў fPc@sdZddlZddlZddlZddlZyddlZWnek r`dZYnXddddddgZ d d d d d ddddg Z d.a daGdddZd/ddZd/ddZd/ddZd/ddZdddZddZddZeedkrddlZdZdddZy5ejejd dd!d"d#d$g\ZZWn5ejk rZ zed e WYddZ [ XnXd Z!dZ"xWeD]O\Z#Z$e#d0kredqe#d1kr dZ!qe#d2krd Z"qqWxeD]|Z%e"rhee%e!Z&e&s[e'd+e%qe'e&q*ee%e!\Z&Z(e&se'd+e%q*e'd,e&d-e(q*WndS(3uGuess 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 iNu guess_typeuguess_extensionuguess_all_extensionsuadd_typeuread_mime_typesuinitu/etc/mime.typesu/etc/httpd/mime.typesu/etc/httpd/conf/mime.typesu/etc/apache/mime.typesu/etc/apache2/mime.typesu$/usr/local/etc/httpd/conf/mime.typesu"/usr/local/lib/netscape/mime.typesu/usr/local/etc/mime.typescBs|EeZdZdZfdddZdddZdddZddd Zdd d Z dd d Z dddZ dddZ dS(u MimeTypesuMIME-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. cCststntj|_tj|_iif|_iif|_x-tjD]\}}|j||dqYWx-t jD]\}}|j||dqWx|D]}|j ||qWdS(NTF( uiniteduinitu encodings_mapucopyu suffix_mapu types_mapu types_map_invuitemsuadd_typeuTrueu common_typesuFalseuread(uselfu filenamesustrictuextutypeuname((u./opt/alt/python33/lib64/python3.3/mimetypes.pyu__init__@s  uMimeTypes.__init__cCsJ||j||<|j|j|g}||krF|j|ndS(uAdd a mapping between a type and an extension. When the extension is already known, the new type will replace the old one. When the type is already known the extension will be added to the list of known extensions. If strict is true, information will be added to list of standard types, else to the list of non-standard types. N(u types_mapu types_map_invu setdefaultuappend(uselfutypeuextustrictuexts((u./opt/alt/python33/lib64/python3.3/mimetypes.pyuadd_typeNs  uMimeTypes.add_typec Cstjj|\}}|dkr|jd}|dkrCd S|jdd|}|dkrw|d|}n|d|}d|ksd|krd}n|dfStj|\}}x3||jkrtj||j|\}}qW||jkr1|j|} tj|\}}nd} |j d } || kr^| || fS|j | kr| |j | fS|rd| fS|j d } || kr| || fS|j | kr| |j | fSd| fSdS( u:Guess the type of a file based on its URL. Return value is a tuple (type, encoding) where type is None if the type can't be guessed (no or unknown suffix) or a string of the form type/subtype, usable for a MIME Content-type header; and encoding is None for no encoding or the name of the program used to encode (e.g. compress or gzip). The mappings are table driven. Encoding suffixes are case sensitive; type suffixes are first tried case sensitive, then case insensitive. The suffixes .tgz, .taz and .tz (case sensitive!) are all mapped to '.tar.gz'. (This is table-driven too, using the dictionary suffix_map.) Optional `strict' argument when False adds a bunch of commonly found, but non-standard types. udatau,iu;Nu=u/u text/plain(NNTF( uurllibuparseu splittypeufinduNoneu posixpathusplitextu suffix_mapu encodings_mapu types_mapuTrueuloweruFalse( uselfuurlustrictuschemeucommausemiutypeubaseuextuencodingu types_map((u./opt/alt/python33/lib64/python3.3/mimetypes.pyu guess_type_s@     $      uMimeTypes.guess_typecCsr|j}|jdj|g}|snx@|jdj|gD]"}||krE|j|qEqEWn|S(uGuess the extensions for a file based on its MIME type. Return value is a list of strings giving the possible filename extensions, including the leading dot ('.'). The extension is not guaranteed to have been associated with any particular data stream, but would be mapped to the MIME type `type' by guess_type(). Optional `strict' argument when false adds a bunch of commonly found, but non-standard types. TF(uloweru types_map_invuTrueugetuFalseuappend(uselfutypeustrictu extensionsuext((u./opt/alt/python33/lib64/python3.3/mimetypes.pyuguess_all_extensionss   uMimeTypes.guess_all_extensionscCs$|j||}|sdS|dS(u Guess the extension for a file based on its MIME type. Return value is a string giving a filename extension, including the leading dot ('.'). The extension is not guaranteed to have been associated with any particular data stream, but would be mapped to the MIME type `type' by guess_type(). If no extension can be guessed for `type', None is returned. Optional `strict' argument when false adds a bunch of commonly found, but non-standard types. iN(uguess_all_extensionsuNone(uselfutypeustrictu extensions((u./opt/alt/python33/lib64/python3.3/mimetypes.pyuguess_extensions uMimeTypes.guess_extensionc Cs/t|dd}|j||WdQXdS(u Read a single mime.types-format file, specified by pathname. If strict is true, information will be added to list of standard types, else to the list of non-standard types. uencodinguutf-8N(uopenureadfp(uselfufilenameustrictufp((u./opt/alt/python33/lib64/python3.3/mimetypes.pyureadsuMimeTypes.readc Csx|j}|sPn|j}x?tt|D]+}||ddkr8||d=Pq8q8W|ssqn|d|dd}}x%|D]}|j|d||qWqdS(u Read a single mime.types-format file. If strict is true, information will be added to list of standard types, else to the list of non-standard types. iu#Niu.(ureadlineuspliturangeulenuadd_type( uselfufpustrictulineuwordsuiutypeusuffixesusuff((u./opt/alt/python33/lib64/python3.3/mimetypes.pyureadfps    uMimeTypes.readfpcCsts dSdd}tjtjd}x||D]}yttj||\}|jdsnw;ntj|d\}}|tjkrw;n|j|||WdQXWq;tk rw;Yq;Xq;WWdQXdS(u Load the MIME types database from Windows registry. If strict is true, information will be added to list of standard types, else to the list of non-standard types. Nc ssKd}x>ytj||}Wntk r4PYnX|V|d7}q dS(Nii(u_winreguEnumKeyuEnvironmentError(umimedbuiuctype((u./opt/alt/python33/lib64/python3.3/mimetypes.pyu enum_typess u3MimeTypes.read_windows_registry..enum_typesuu.u Content Type(u_winreguOpenKeyuHKEY_CLASSES_ROOTu startswithu QueryValueExuREG_SZuadd_typeuEnvironmentError(uselfustrictu enum_typesuhkcru subkeynameusubkeyumimetypeudatatype((u./opt/alt/python33/lib64/python3.3/mimetypes.pyuread_windows_registrys   uMimeTypes.read_windows_registryNT( u__name__u __module__u __qualname__u__doc__uTrueu__init__uadd_typeu guess_typeuguess_all_extensionsuguess_extensionureadureadfpuread_windows_registry(u __locals__((u./opt/alt/python33/lib64/python3.3/mimetypes.pyu MimeTypes8s> u MimeTypescCs&tdkrtntj||S(uGuess the type of a file based on its URL. Return value is a tuple (type, encoding) where type is None if the type can't be guessed (no or unknown suffix) or a string of the form type/subtype, usable for a MIME Content-type header; and encoding is None for no encoding or the name of the program used to encode (e.g. compress or gzip). The mappings are table driven. Encoding suffixes are case sensitive; type suffixes are first tried case sensitive, then case insensitive. The suffixes .tgz, .taz and .tz (case sensitive!) are all mapped to ".tar.gz". (This is table-driven too, using the dictionary suffix_map). Optional `strict' argument when false adds a bunch of commonly found, but non-standard types. N(u_dbuNoneuinitu guess_type(uurlustrict((u./opt/alt/python33/lib64/python3.3/mimetypes.pyu guess_type s  cCs&tdkrtntj||S(uGuess the extensions for a file based on its MIME type. Return value is a list of strings giving the possible filename extensions, including the leading dot ('.'). The extension is not guaranteed to have been associated with any particular data stream, but would be mapped to the MIME type `type' by guess_type(). If no extension can be guessed for `type', None is returned. Optional `strict' argument when false adds a bunch of commonly found, but non-standard types. N(u_dbuNoneuinituguess_all_extensions(utypeustrict((u./opt/alt/python33/lib64/python3.3/mimetypes.pyuguess_all_extensions#s  cCs&tdkrtntj||S(uGuess the extension for a file based on its MIME type. Return value is a string giving a filename extension, including the leading dot ('.'). The extension is not guaranteed to have been associated with any particular data stream, but would be mapped to the MIME type `type' by guess_type(). If no extension can be guessed for `type', None is returned. Optional `strict' argument when false adds a bunch of commonly found, but non-standard types. N(u_dbuNoneuinituguess_extension(utypeustrict((u./opt/alt/python33/lib64/python3.3/mimetypes.pyuguess_extension4s  cCs)tdkrtntj|||S(uiAdd a mapping between a type and an extension. When the extension is already known, the new type will replace the old one. When the type is already known the extension will be added to the list of known extensions. If strict is true, information will be added to list of standard types, else to the list of non-standard types. N(u_dbuNoneuinituadd_type(utypeuextustrict((u./opt/alt/python33/lib64/python3.3/mimetypes.pyuadd_typeDs  cCsdat}|dkr7tr.|jnt}nx0|D](}tjj |r>|j |q>q>W|j a |j a |j da |j da|adS(NTF(uTrueuinitedu MimeTypesuNoneu_winreguread_windows_registryu knownfilesuosupathuisfileureadu encodings_mapu suffix_mapu types_mapuFalseu common_typesu_db(ufilesudbufile((u./opt/alt/python33/lib64/python3.3/mimetypes.pyuinitUs         cCs^yt|}Wntk r(dSYnX|)t}|j|d|jdSWdQXdS(NT(uopenuIOErroruNoneu MimeTypesureadfpuTrueu types_map(ufileufudb((u./opt/alt/python33/lib64/python3.3/mimetypes.pyuread_mime_typesis   cCs idd6dd6dd6dd6dd6d d 6aid d 6d d6dd6dd6ai~dd6dd6dd6dd6dd6dd6dd6dd 6d!d"6dd#6d$d%6dd&6d'd(6d)d(6d*d+6d,d-6d.d/6dd06d1d26d1d36d4d56d6d76dd86d9d:6dd;6d<d=6d>d?6dd@6dAdB6dCdD6dCdE6dFdG6dHdI6dJdK6dJdL6dJdM6dNdO6ddP6dQdR6dSdT6dUdV6dUdW6dXdY6dZd[6d6d\6d6d]6d^d_6d`da6dbdc6ddde6dddf6dgdh6dSdi6dSdj6dSdk6dSdl6dmdn6d)do6d6dp6ddq6ddr6dsdt6dudv6dwdx6dydz6d{d|6dud}6d~d6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6d`d6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6d1d6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6aiddM6dd6dd6dd6dd6dd6dd6dd6adS(Nu.svg.gzu.svgzu.tar.gzu.tgzu.tazu.tzu.tar.bz2u.tbz2u.tar.xzu.txzugzipu.gzucompressu.Zubzip2u.bz2uxzu.xzuapplication/octet-streamu.auapplication/postscriptu.aiu audio/x-aiffu.aifu.aifcu.aiffu audio/basicu.auuvideo/x-msvideou.aviu text/plainu.batuapplication/x-bcpiou.bcpiou.binuimage/x-ms-bmpu.bmpu.cuapplication/x-cdfu.cdfuapplication/x-netcdfuapplication/x-cpiou.cpiouapplication/x-cshu.cshutext/cssu.cssu.dlluapplication/mswordu.docu.dotuapplication/x-dviu.dviumessage/rfc822u.emlu.epsu text/x-setextu.etxu.exeu image/gifu.gifuapplication/x-gtaru.gtaru.huapplication/x-hdfu.hdfu text/htmlu.htmu.htmluimage/vnd.microsoft.iconu.icou image/iefu.iefu image/jpegu.jpeu.jpegu.jpguapplication/javascriptu.jsu.kshuapplication/x-latexu.latexu video/mpegu.m1vuapplication/vnd.apple.mpegurlu.m3uu.m3u8uapplication/x-troff-manu.manuapplication/x-troff-meu.meu.mhtu.mhtmluapplication/x-mifu.mifuvideo/quicktimeu.movuvideo/x-sgi-movieu.movieu audio/mpegu.mp2u.mp3u video/mp4u.mp4u.mpau.mpeu.mpegu.mpguapplication/x-troff-msu.msu.ncu.nwsu.ou.objuapplication/odau.odauapplication/x-pkcs12u.p12uapplication/pkcs7-mimeu.p7cuimage/x-portable-bitmapu.pbmuapplication/pdfu.pdfu.pfxuimage/x-portable-graymapu.pgmu.plu image/pngu.pnguimage/x-portable-anymapu.pnmuapplication/vnd.ms-powerpointu.potu.ppauimage/x-portable-pixmapu.ppmu.ppsu.pptu.psu.pwzu text/x-pythonu.pyuapplication/x-python-codeu.pycu.pyou.qtuaudio/x-pn-realaudiou.rauapplication/x-pn-realaudiou.ramuimage/x-cmu-rasteru.rasuapplication/xmlu.rdfu image/x-rgbu.rgbuapplication/x-troffu.roffu text/richtextu.rtxu text/x-sgmlu.sgmu.sgmluapplication/x-shu.shuapplication/x-sharu.sharu.sndu.souapplication/x-wais-sourceu.srcuapplication/x-sv4cpiou.sv4cpiouapplication/x-sv4crcu.sv4crcu image/svg+xmlu.svguapplication/x-shockwave-flashu.swfu.tuapplication/x-taru.taruapplication/x-tclu.tcluapplication/x-texu.texuapplication/x-texinfou.texiu.texinfou image/tiffu.tifu.tiffu.trutext/tab-separated-valuesu.tsvu.txtuapplication/x-ustaru.ustaru text/x-vcardu.vcfu audio/x-wavu.wavu.wizu.wsdluimage/x-xbitmapu.xbmuapplication/vnd.ms-excelu.xlbuapplication/excelu.xlsutext/xmlu.xmlu.xpdluimage/x-xpixmapu.xpmu.xsluimage/x-xwindowdumpu.xwduapplication/zipu.zipu image/jpgu audio/midiu.midu.midiu image/pictu.pctu.picu.pictuapplication/rtfu.rtfutext/xulu.xul(u suffix_mapu encodings_mapu types_mapu common_types(((u./opt/alt/python33/lib64/python3.3/mimetypes.pyu_default_mime_typests(   u_default_mime_typesu__main__u4Usage: 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. ucCs.tt|rt|ntj|dS(N(uprintuUSAGEusysuexit(ucodeumsg((u./opt/alt/python33/lib64/python3.3/mimetypes.pyuusage4s  uusageiuhleuhelpulenientu extensionu-hu--helpu-lu --lenientu-eu --extensionu I don't know anything about typeutype:u encoding:FT(u-hu--help(u-lu --lenient(u-eu --extension()u__doc__uosusysu posixpathu urllib.parseuurllibuwinregu_winregu ImportErroruNoneu__all__u knownfilesuFalseuinitedu_dbu MimeTypesuTrueu guess_typeuguess_all_extensionsuguess_extensionuadd_typeuinituread_mime_typesu_default_mime_typesu__name__ugetoptuUSAGEuusageuargvuoptsuargsuerrorumsgustrictu extensionuoptuargugtypeuguessuprintuencoding(((u./opt/alt/python33/lib64/python3.3/mimetypes.pyust