
TaΈ2c      sq     d  Z   d   k Z  k Z  k Z  d   Z * d   Z ; d   Z L e d j o M e   n d S(   sj   Mac specific module for conversion between pathnames and URLs.
Do not import directly, use urllib instead.c   sυ   	 d   t  i |   d }  | o
 | d j o  t d  n  t i |  d  }  d }  xπ  | t	 |  j  oΩ  | | d j o  | | =n΄  | | d j o% | d j o | | d d d f j o&  | | d | d 5 | d } nR  | | d j o | d j o | | d d j o  | | =n  | d } qk W | d o   t i
 | d d	  Snm $ d } % xF % | t	 |  j  o | | d j o & d | | <' | d } qW( d	 t i
 | d	  Sd
 S(   s,   Convert /-delimited pathname to mac pathnamei    s   files(   Cannot convert non-local URL to pathnames   /s   .s   ..i   s    s   :N(   s   urllibs	   splittypes   pathnames   tps   RuntimeErrors   strings   splits
   componentss   is   lens   join(   s   pathnames   tps
   componentss   is!   /usr/lib/python1.4/macurl2path.pys   url2pathnamec   sι   * + d  , d |  j o - t d  n . t i |  d  } 0 xG t d t |   d 0 r+ } 1 | | d j o 2 d | | <n qZ W4 t d   |  } 6 t	 i
 i |   o 7 d t i | d  Sn 9 t i | d  Sd	 S(
   s,   convert mac pathname to /-delimited pathnames   /s*   Cannot convert pathname containing slashess   :i   i    s    s   ..c   s   4 |  d  S(   Ni   (   s   x(   s   xs!   /usr/lib/python1.4/macurl2path.pys   <lambda>N(   s   pathnames   RuntimeErrors   strings   splits
   componentss   ranges   lens   is   maps   oss   paths   isabss   join(   s   pathnames
   componentss   is!   /usr/lib/python1.4/macurl2path.pys   pathname2urlc    s   ; < x: d d d d d g d < r }  A |  Gd Gt |   GHq WB xC d d	 d
 d d d d d g d B r } J | Gd Gt |  GHqg Wd  S(   Ns
   index.htmls   bar/index.htmls   /foo/bar/index.htmls	   /foo/bar/s   /i    s   ->s   drive:s
   drive:dir:s   drive:dir:files
   drive:files   files   :files   :dir:s	   :dir:file(   s   urls   url2pathnames   paths   pathname2url(   s   urls   paths!   /usr/lib/python1.4/macurl2path.pys   tests   __main__N(   s   __doc__s   strings   urllibs   oss   url2pathnames   pathname2urls   tests   __name__(    s!   /usr/lib/python1.4/macurl2path.pys   ?