ó
xFWgc           @   s   d  Z  d   Z d   Z d S(   s3   Convert a NT pathname to a file URL and vice versa.c         C   sW  d d l  } d d l } |  j d d  }  d |  k rx |  d  d k rS |  d }  n  |  j d  } | j d	 j |   S|  j d  } t |  d k s° | d
 d | j k rĆ d |  } t |  n  | d
 d j	   } | d } | d j d  } x. | D]& } | rţ | d	 | j |  } qţ qţ W| j
 d  rS|  j
 d  rS| d	 7} n  | S(   s{   OS-specific conversion from a relative URL of the 'file' scheme
    to a file system path; not recommended for general use.i˙˙˙˙Nt   :t   |i   s   ////i   t   /s   \i    s	   Bad URL: i   (   t   stringt   urllibt   replacet   splitt   unquotet   joint   lent   ascii_letterst   IOErrort   uppert   endswith(   t   urlR   R   t
   componentst   compt   errort   drivet   path(    (    s    /usr/lib/python2.7/nturl2path.pyt   url2pathname   s(    	)

c         C   s  d d l  } d |  k rZ |  d  d k r5 d |  }  n  |  j d  } | j d j |   S|  j d  } t |  d k s t | d  d	 k r§ d
 |  } t |  n  | j | d j    } | d	 j d  } d | d } x. | D]& } | rč | d | j |  } qč qč W| S(   s{   OS-specific conversion from a file system path to a relative URL
    of the 'file' scheme; not recommended for general use.i˙˙˙˙NR    i   s   \\s   \R   i    i   s
   Bad path: s   ///(   R   R   t   quoteR   R	   R   R   (   t   pR   R   R   R   R   R   (    (    s    /usr/lib/python2.7/nturl2path.pyt   pathname2url(   s"    (
N(   t   __doc__R   R   (    (    (    s    /usr/lib/python2.7/nturl2path.pyt   <module>   s   	%