‡Æ
çMö9c       sÊ    d  Z    d k Z  d k Z  d k Z  d d d d g Z % d Z ' d „  Z \ d „  Z n e d „ Z	 w d	 „  Z
 Œ h  d
 d <d
 d <d
 d <Z ’ h  d d <d d <Z — 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) <d d* <d d+ <d, d- <d. d/ <d0 d1 <d2 d3 <d4 d5 <d4 d6 <d7 d8 <d9 d: <d9 d; <d9 d< <d= d> <d? d@ <dA dB <dC dD <dE dF <dG dH <dI dJ <dK dL <dK dM <dK dN <dO dP <d! dQ <d dR <d dS <dT dU <dV dW <dX dY <dZ d[ <d\ d] <d^ d_ <d` da <db dc <dd de <d df <dG dg <dh di <dj dk <dl dm <dn do <dp dq <dr ds <dt du <dt dv <dw dx <dy dz <d d{ <d d| <d} d~ <d d€ <d d‚ <dn dƒ <d„ d… <d† d‡ <dˆ d‰ <dŠ d‹ <dŠ dŒ <d dŽ <d d <dn d <d‘ d’ <d“ d” <d• d– <d— d˜ <d™ dš <d› dœ <dl d <dž dŸ <d  d¡ <d¢ d£ <Z d S(¤   s–  Guess the MIME type of a file.

This module defines two useful functions:

guess_type(url) -- guess the MIME type and encoding of a URL.

guess_extension(type) -- 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
suffixes_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$   /usr/local/etc/httpd/conf/mime.typess"   /usr/local/lib/netscape/mime.typess   /usr/local/etc/mime.typesi    c    s  ' 6 7 t  o 8 t ƒ  n 9 t i |  ƒ \ } }  : | d j oº A t i |  d ƒ } B | d j  o D t	 t	 f Sn E t i |  d d | ƒ } F | d j o G |  |  } n I |  |  } J d | j p
 d | j o K d } n L | t	 f Sn M t i |  ƒ \ } } N x8 N t i | ƒ o$ O t i | t | ƒ \ } } qWP t i | ƒ o) Q t | } R t i | ƒ \ } } n
 T t	 } U t i | ƒ o V t | | f SnH W t i t i | ƒ ƒ o X t t i | ƒ | f Sn Z 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).

    s   datas   ,i    s   ;s   =s   /s
   text/plainN(   s   initeds   inits   urllibs	   splittypes   urls   schemes   strings   finds   commas   Nones   semis   types	   posixpaths   splitexts   bases   exts
   suffix_maps   has_keys   encodings_maps   encodings	   types_maps   lower(   s   urls   schemes   commas   semis   types   bases   exts   encodings&   /mit/python/lib/python2.0/mimetypes.pys
   guess_type' s8    %	c    s   \ d e f t  o g t ƒ  n h t i |  ƒ }  i x: t i ƒ  d i r' \ } } j |  | j o k | Sn qF Wl 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.
    i    N(
   s   initeds   inits   strings   lowers   types	   types_maps   itemss   exts   stypes   None(   s   types   exts   stypes&   /mit/python/lib/python2.0/mimetypes.pys   guess_extension\ s    c    s‚   n o p xi |  p t d p rU } q t | ƒ } r | o6 s x, | i ƒ  d s r \ } } t | t | <qM Wn q Wu d a	 d  S(   Ni    i   (
   s   filess
   knownfiless   files   read_mime_typess   ss   itemss   keys   values	   types_maps   inited(   s   filess   files   ss   keys   values&   /mit/python/lib/python2.0/mimetypes.pys   initn s    	
 c 	   sN  w x y y t  |  ƒ } Wn z t j
 o { t Sn X| h  } } xî } d oã ~ | i ƒ  }  | o  Pn € t i	 | ƒ }  xI t t | ƒ ƒ d  r0 } ‚ | | d d j o ƒ | | 3„ Pn qž W… | o
 … qH n † | d | d f \ } } ‡ x$ | d ‡ r } ˆ | | d | <qWqH W‰ | i ƒ  Š | Sd  S(   Ni   i    s   #s   .(   s   opens   files   fs   IOErrors   Nones   maps   readlines   lines   strings   splits   wordss   ranges   lens   is   types   suffixess   suffs   close(	   s   files   fs   maps   lines   wordss   is   types   suffixess   suffs&   /mit/python/lib/python2.0/mimetypes.pys   read_mime_typesw s0   	 
  	
 
 	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   application/x-bcpios   .bcpios   .bins   application/x-netcdfs   .cdfs   application/x-cpios   .cpios   application/x-cshs   .cshs   .dlls   application/x-dvis   .dvis   .exes   .epss   text/x-setexts   .etxs	   image/gifs   .gifs   application/x-gtars   .gtars   application/x-hdfs   .hdfs	   text/htmls   .htms   .htmls	   image/iefs   .iefs
   image/jpegs   .jpes   .jpegs   .jpgs   application/x-javascripts   .jss   application/x-latexs   .latexs   application/x-troff-mans   .mans   application/x-troff-mes   .mes   application/x-mifs   .mifs   video/quicktimes   .movs   video/x-sgi-movies   .movies
   video/mpegs   .mpes   .mpegs   .mpgs   application/x-troff-mss   .mss   .ncs   .os   .objs   application/odas   .odas   image/x-portable-bitmaps   .pbms   application/pdfs   .pdfs   image/x-portable-graymaps   .pgms   image/x-portable-anymaps   .pnms	   image/pngs   .pngs   image/x-portable-pixmaps   .ppms   text/x-pythons   .pys   application/x-python-codes   .pycs   .pss   .qts   image/x-cmu-rasters   .rass   image/x-rgbs   .rgbs   application/xmls   .rdfs   application/x-troffs   .roffs   application/rtfs   .rtfs   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
   text/plains   .txts   application/x-ustars   .ustars   audio/x-wavs   .wavs   image/x-xbitmaps   .xbms   text/xmls   .xmls   .xsls   image/x-xpixmaps   .xpms   image/x-xwindowdumps   .xwds   application/zips   .zip(   s   __doc__s   strings	   posixpaths   urllibs
   knownfiless   initeds
   guess_types   guess_extensions   Nones   inits   read_mime_typess
   suffix_maps   encodings_maps	   types_map(    s&   /mit/python/lib/python2.0/mimetypes.pys   ? s   	5	$