¯ÕYfŒ ã@s"dZdd„Zdd„ZdS)z3Convert a NT pathname to a file URL and vice versa.cCs`ddl}ddl}|jddƒ}d|kr„|dd…dkr\|dd…}|jdƒ}|jjd j|ƒƒS|jdƒ}t|ƒdks¼|dd |jkrÒd |}t |ƒ‚|dd j ƒ}|d jdƒ}|d}x.|D]&}|r |d |jj|ƒ}q W|j dƒr\|j dƒr\|d 7}|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ú//opt/alt/python35/lib64/python3.5/nturl2path.pyÚ url2pathnames(  )     rcCsddl}d|kr`|dd…dkr8d|}|jdƒ}|jjdj|ƒƒS|jdƒ}t|ƒdks—t|dƒdkr­d |}t|ƒ‚|jj|djƒƒ}|djdƒ}d |d}x.|D]&}|rñ|d|jj|ƒ}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 %