î ¼ê[\ ã@s"dZdd„Zdd„ZdS)z3Convert a NT pathname to a file URL and vice versa.cCslddl}ddl}|jddƒ}d|kr‡|dd…dkr_|dd…}n|jdƒ}|jjd j|ƒƒS|jdƒ}t|ƒdks¿|dd |jkrØd |}t |ƒ‚n|dd j ƒ}|d jdƒ}|d}x1|D])}|r|d |jj|ƒ}qqW|j dƒrh|j dƒrh|d 7}n|S)z{OS-specific conversion from a relative URL of the 'file' scheme to a file system path; not recommended for general use.éNú:ú|éz////éú/ú\éz Bad URL: éÿÿÿÿr ) ÚstringÚ urllib.parseÚreplaceÚsplitÚparseZunquoteÚjoinÚlenZ ascii_lettersÚOSErrorÚupperÚendswith)Zurlr ÚurllibÚ componentsÚcompÚerrorÚdriveÚpath©rú /usr/lib/python3.4/nturl2path.pyÚ url2pathnames( )   ! rcCs(ddl}d|krc|dd…dkr;d|}n|jdƒ}|jjdj|ƒƒS|jdƒ}t|ƒdksšt|dƒdkr³d |}t|ƒ‚n|jj|djƒƒ}|djdƒ}d |d}x1|D])}|r÷|d|jj|ƒ}q÷q÷W|S) z{OS-specific conversion from a file system path to a relative URL of the 'file' scheme; not recommended for general use.rNrrz\\rrrz Bad path: z///)r r rZquoterrrr)ÚprrrrrrrrrÚ pathname2url&s"   (  !rN)Ú__doc__rrrrrrÚs #