3 \¬ ã@s8dZddlZddlZddgZdd„Zdd„Zdd„ZdS) zqMacintosh-specific module for conversion between pathnames and URLs. Do not import directly; use urllib instead.éNÚ url2pathnameÚ pathname2urlcCsttjj|ƒd}|r$|dkr$tdƒ‚|dd…dkrB|dd…}n|dd…dkrZtdƒ‚|jd ƒ}d}xš|t|ƒk�r||d krŒ||=qj||d krÌ|dkrÌ||d dkrÌ||d |d …=|d }qj||d krø|dkrø||d d krø||=qj|d }qjW|d�s"dj|d d…ƒ}nFd}x2|t|ƒk�rX||d k�rXd ||<|d }�q(Wddj|ƒ}tjj|ƒS)z{OS-specific conversion from a relative URL of the 'file' scheme to a file system path; not recommended for general use.rÚfilez(Cannot convert non-local URL to pathnameNéz///éz//ú/Ú.ú..éÚú:)r r )ÚurllibÚparseZ splittypeÚ RuntimeErrorÚsplitÚlenÚjoinZunquote)ÚpathnameÚtpÚ componentsÚiÚrv©rú#/usr/lib64/python3.6/macurl2path.pyr s6    $  cCsšd|krtdƒ‚|jdƒ}|ddkr,|d=|d dkr>|d =x(tt|ƒƒD]}||dkrLd||<qLWtt|ƒ}tjj|ƒrŒddj |ƒSdj |ƒSdS) z{OS-specific conversion from a file system path to a relative URL of the 'file' scheme; not recommended for general use.rz*Cannot convert pathname containing slashesr rr r z..Néÿÿÿÿr) rrÚrangerÚmapÚ _pncomp2urlÚosÚpathÚisabsr)rrrrrrr4s       cCstjj|dd…dd�S)Nér )Zsafe)r rZquote)Z componentrrrrKsr)Ú__doc__Z urllib.parser rÚ__all__rrrrrrrÚs *