-í
ç¶<c       sÌ  d  Z  d k Z d k Z d k Z d d d d g Z d d d d g Z d	 a d
 f  d „  ƒ  YZ d d „ a d d „ a	 e
 d „ Z d „  Z h  d d <d d <d d <a h  d d <d d <a h  d d <d d <d d <d d <d d  <d! d" <d# d$ <d% d& <d' d( <d d) <d* d+ <d% d, <d- d. <d/ d. <d0 d1 <d2 d3 <d4 d5 <d d6 <d7 d8 <d7 d9 <d: d; <d< d= <d d> <d? d@ <d dA <dB dC <dD dE <d% dF <dG dH <dI dJ <dI dK <dL dM <dN dO <dN dP <dN dQ <dR dS <d% dT <dU dV <dW dX <dY dZ <d[ d\ <d< d] <d< d^ <d_ d` <da db <dc dd <de df <de dg <dW dh <dW di <dW dj <dW dk <dl dm <d/ dn <d< do <d dp <d dq <dr ds <dt du <dv dw <dx dy <dz d{ <dt d| <d} d~ <d% d <d€ d <d‚ dƒ <d„ d… <d„ d† <d‡ dˆ <d„ d‰ <d„ dŠ <d d‹ <d„ dŒ <d dŽ <d d <d d‘ <da d’ <d“ d” <d• d– <d— d˜ <d™ dš <d› dœ <d dž <dŸ d  <d¡ d¢ <d¡ d£ <d¤ d¥ <d¦ d§ <d! d¨ <d d© <dª d« <d¬ d­ <d® d¯ <d d° <d± d² <d³ d´ <dµ d¶ <d· d¸ <d· d¹ <dº d» <dº d¼ <d d½ <d¾ d¿ <d% dÀ <dÁ dÂ <dÃ dÄ <dÅ dÆ <d7 dÇ <dÈ dÉ <dÊ dË <dÌ dÍ <dÊ dÍ <dÎ dÏ <dÐ dÑ <d™ dÒ <dÓ dÔ <dÕ dÖ <a h  d× dQ <dØ dÙ <dØ dÚ <dÛ dÜ <dÛ dÝ <dÛ dÞ <dß dà <dá dâ <a e dã j o}d k Z d k Z dä Z då dæ „ Z y/ e i e i d dç dè dé dê g ƒ \ Z Z Wn% e i j
 o Z e d e ƒ n Xd Z d	 Z xo e D]g \ Z Z e dë dì f j o e d	 ƒ n; e dí dî f j o
 d	 Z n e dï dð f j o
 d Z n qÙWx} e D]u Z e o- t	 e e ƒ Z  e  o dñ Ge GHn e  GHn< t e e ƒ \ Z  Z! e  o dñ Ge GHn dò Ge  Gdó Ge! GHqKWn d S(ô   s§  Guess the MIME type of a file.

This module defines two useful functions:

guess_type(url, strict=1) -- guess the MIME type and encoding of a URL.

guess_extension(type, strict=1) -- 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
read_mime_types(file) -- parse one file, return a dictionary or None
Ns
   guess_types   guess_extensions   read_mime_typess   inits$   /usr/local/etc/httpd/conf/mime.typess"   /usr/local/lib/netscape/mime.typess   /usr/local/etc/mime.typesi    s	   MimeTypesc      sD   t  Z d  Z f  d „ Z d d „ Z d d „ Z d „  Z d „  Z RS(   sç   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.
    c    sq   t  o t ƒ  n t i ƒ  |  _ t i ƒ  |  _ t i ƒ  |  _ t i ƒ  |  _ x | D] } |  i
 | ƒ qV Wd  S(   N(   s   initeds   inits   encodings_maps   copys   selfs
   suffix_maps	   types_maps   common_typess	   filenamess   names   read(   s   selfs	   filenamess   name(    (    s   /usr/lib/python2.2/mimetypes.pys   __init__1 s     i   c    s  t  i | ƒ \ } } | d j o– | i d ƒ } | d j  o t t f Sn | i d d | ƒ } | d j o | |  }	 n | |  }	 d |	 j p
 d |	 j o
 d }	 n |	 t f Sn t	 i
 | ƒ \ } } x8 |  i i | ƒ o$ t	 i
 | |  i | ƒ \ } } qÐ W|  i i | ƒ o& |  i | } t	 i
 | ƒ \ } } n t } |  i } |  i }
 | i | ƒ o | | | f Snž | i | i ƒ  ƒ o | | i ƒ  | f Snp | o t | f Sn[ |
 i | ƒ o |
 | | f Sn9 |
 i | i ƒ  ƒ o |
 | i ƒ  | f Sn t | f Sd S(	   s:  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.
        s   datas   ,i    s   ;s   =s   /s
   text/plainN(   s   urllibs	   splittypes   urls   schemes   finds   commas   Nones   semis   types	   posixpaths   splitexts   bases   exts   selfs
   suffix_maps   has_keys   encodings_maps   encodings	   types_maps   common_typess   lowers   strict(   s   selfs   urls   stricts   semis   encodings   exts   bases   commas   schemes   types   common_typess	   types_map(    (    s   /usr/lib/python2.2/mimetypes.pys
   guess_type; sD     

 %		c    s‡   | i ƒ  } x2 |  i i ƒ  D]! \ } } | | j o | Sn q W| o6 x/ t i ƒ  D]! \ } } | | j o | Sn qV Wn t	 Sd S(   s  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.
        N(
   s   types   lowers   selfs	   types_maps   itemss   exts   stypes   stricts   common_typess   None(   s   selfs   types   stricts   exts   stype(    (    s   /usr/lib/python2.2/mimetypes.pys   guess_extensiony s       c    s'   t  | ƒ } |  i | ƒ | i ƒ  d S(   s<   Read a single mime.types-format file, specified by pathname.N(   s   opens   filenames   fps   selfs   readfps   close(   s   selfs   filenames   fp(    (    s   /usr/lib/python2.2/mimetypes.pys   read s     c 	   sÇ   |  i } x· d o¯ | i ƒ  } | o Pn | i ƒ  } x; t t	 | ƒ ƒ D]' } | | d d j o | | 3Pn qK W| o q n | d | d f \ } } x | D] } | | d | <q¦ Wq Wd S(   s%   Read a single mime.types-format file.i   i    s   #s   .N(   s   selfs	   types_maps   maps   fps   readlines   lines   splits   wordss   ranges   lens   is   types   suffixess   suff(	   s   selfs   fps   maps   suffs   is   wordss   lines   types   suffixes(    (    s   /usr/lib/python2.2/mimetypes.pys   readfp– s&     	  	 (   s   __name__s
   __module__s   __doc__s   __init__s
   guess_types   guess_extensions   reads   readfp(    (    (    s   /usr/lib/python2.2/mimetypes.pys	   MimeTypes) s    
>	i   c    s   t  ƒ  t |  | ƒ Sd S(   sþ  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.
    N(   s   inits
   guess_types   urls   strict(   s   urls   strict(    (    s   /usr/lib/python2.2/mimetypes.pys
   guess_type© s     c    s   t  ƒ  t |  | ƒ Sd S(   sã  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.
    N(   s   inits   guess_extensions   types   strict(   s   types   strict(    (    s   /usr/lib/python2.2/mimetypes.pys   guess_extension¿ s     c    s›   d a  t ƒ  } |  t j o
 t }  n x8 |  D]0 } t i i	 | ƒ o | i
 t | ƒ ƒ n q- W| i a | i a | i a | i a | i a | i a d  S(   Ni   (   s   initeds	   MimeTypess   dbs   filess   Nones
   knownfiless   files   oss   paths   isfiles   readfps   opens   encodings_maps
   suffix_maps	   types_maps   guess_extensions
   guess_types   common_types(   s   filess   dbs   file(    (    s   /usr/lib/python2.2/mimetypes.pys   initÏ s"       	
 					c    sK   y t  |  ƒ } Wn t j
 o t Sn Xt ƒ  } | i | ƒ | i Sd  S(   N(	   s   opens   files   fs   IOErrors   Nones	   MimeTypess   dbs   readfps	   types_map(   s   files   fs   db(    (    s   /usr/lib/python2.2/mimetypes.pys   read_mime_typesâ s    		s   .tar.gzs   .tgzs   .tazs   .tzs   gzips   .gzs   compresss   .Zs   application/octet-streams   .as   application/postscripts   .ais   audio/x-aiffs   .aifs   .aifcs   .aiffs   audio/basics   .aus   video/x-msvideos   .avis
   text/plains   .bats   application/x-bcpios   .bcpios   .bins   image/x-ms-bmps   .bmps   .cs   application/x-cdfs   .cdfs   application/x-netcdfs   application/x-cpios   .cpios   application/x-cshs   .cshs   text/csss   .csss   .dlls   application/mswords   .docs   .dots   application/x-dvis   .dvis   message/rfc822s   .emls   .epss   text/x-setexts   .etxs   .exes	   image/gifs   .gifs   application/x-gtars   .gtars   .hs   application/x-hdfs   .hdfs	   text/htmls   .htms   .htmls	   image/iefs   .iefs
   image/jpegs   .jpes   .jpegs   .jpgs   application/x-javascripts   .jss   .kshs   application/x-latexs   .latexs
   video/mpegs   .m1vs   application/x-troff-mans   .mans   application/x-troff-mes   .mes   .mhts   .mhtmls   application/x-mifs   .mifs   video/quicktimes   .movs   video/x-sgi-movies   .movies
   audio/mpegs   .mp2s   .mp3s   .mpas   .mpes   .mpegs   .mpgs   application/x-troff-mss   .mss   .ncs   .nwss   .os   .objs   application/odas   .odas   application/x-pkcs12s   .p12s   application/pkcs7-mimes   .p7cs   image/x-portable-bitmaps   .pbms   application/pdfs   .pdfs   .pfxs   image/x-portable-graymaps   .pgms   .pls	   image/pngs   .pngs   image/x-portable-anymaps   .pnms   application/vnd.ms-powerpoints   .pots   .ppas   image/x-portable-pixmaps   .ppms   .ppss   .ppts   .pss   .pwzs   text/x-pythons   .pys   application/x-python-codes   .pycs   .pyos   .qts   audio/x-pn-realaudios   .ras   application/x-pn-realaudios   .rams   image/x-cmu-rasters   .rass   application/xmls   .rdfs   image/x-rgbs   .rgbs   application/x-troffs   .roffs   text/richtexts   .rtxs   text/x-sgmls   .sgms   .sgmls   application/x-shs   .shs   application/x-shars   .shars   .snds   .sos   application/x-wais-sources   .srcs   application/x-sv4cpios   .sv4cpios   application/x-sv4crcs   .sv4crcs   .ts   application/x-tars   .tars   application/x-tcls   .tcls   application/x-texs   .texs   application/x-texinfos   .texis   .texinfos
   image/tiffs   .tifs   .tiffs   .trs   text/tab-separated-valuess   .tsvs   .txts   application/x-ustars   .ustars   text/x-vcards   .vcfs   audio/x-wavs   .wavs   .wizs   image/x-xbitmaps   .xbms   application/vnd.ms-excels   .xlbs   application/excels   .xlss   text/xmls   .xmls   image/x-xpixmaps   .xpms   .xsls   image/x-xwindowdumps   .xwds   application/zips   .zips	   image/jpgs
   audio/midis   .mids   .midis
   image/picts   .pcts   .pics   .picts   application/rtfs   .rtfs   text/xuls   .xuls   __main__s4  Usage: 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.
s    c    s&   t  GH| o	 | GHn t i |  ƒ d  S(   N(   s   USAGEs   msgs   syss   exits   code(   s   codes   msg(    (    s   /usr/lib/python2.2/mimetypes.pys   usage—s     	s   hles   helps   lenients	   extensions   -hs   --helps   -ls	   --lenients   -es   --extensions    I don't know anything about types   type:s	   encoding:("   s   __doc__s   oss	   posixpaths   urllibs   __all__s
   knownfiless   initeds	   MimeTypess
   guess_types   guess_extensions   Nones   inits   read_mime_typess
   suffix_maps   encodings_maps	   types_maps   common_typess   __name__s   syss   getopts   USAGEs   usages   argvs   optss   argss   errors   msgs   stricts	   extensions   opts   args   gtypes   guesss   encoding(   s   opts	   MimeTypess   encodings   argss   syss   USAGEs   msgs   read_mime_typess   args
   knownfiless   guesss	   posixpaths   __all__s	   extensions   urllibs   stricts   inits   usages   getopts   gtypes   oss   opts(    (    s   /usr/lib/python2.2/mimetypes.pys   ? sd   			€	
!
ÿ ÿ ÿ ÿ 0N		 
  	 