Plan 9 from Bell Labs’s /usr/web/sources/contrib/stallion/root/sys/lib/python2.7/macurl2path.pyo

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


�`^c@sIdZddlZddlZddgZd�Zd�Zd�ZdS(sqMacintosh-specific module for conversion between pathnames and URLs.

Do not import directly; use urllib instead.i�Nturl2pathnametpathname2urlcCs�tj|�d}|r1|dkr1td�n|d dkrN|d}n|d dkrjtd�n|jd�}d}x�|t|�krD||d	kr�||=q�||d
kr�dkr�|ddkr�|d|d5|d}q�||dkr7|dkr7||ddkr7||=q�|d}q�W|dsed
j|d�}nVd}x:|t|�kr�||d
kr�d||<|d}qnWd
d
j|�}tj|�S(s{OS-specific conversion from a relative URL of the 'file' scheme
    to a file system path; not recommended for general use.itfiles(Cannot convert non-local URL to pathnameis///is//t/t.s..itt:(Rs..(turllibt	splittypetRuntimeErrortsplittlentjointunquote(tpathnamettpt
componentstitrv((s!/sys/lib/python2.7/macurl2path.pyR
s6


0

%
cCs�d|krtd�n|jd�}|ddkrA|d=n|ddkr[|d=nx7tt|��D]#}||dkrnd||<qnqnWtt|�}tjj|�r�ddj	|�Sdj	|�SdS(	s{OS-specific conversion from a file system path to a relative URL
    of the 'file' scheme; not recommended for general use.Rs*Cannot convert pathname containing slashesRiRi�s..N(
R	R
trangeRtmapt_pncomp2urltostpathtisabsR(RRR((s!/sys/lib/python2.7/macurl2path.pyR4s

cCstj|d dd�}|S(NitsafeR(Rtquote(t	component((s!/sys/lib/python2.7/macurl2path.pyRKs(t__doc__RRt__all__RRR(((s!/sys/lib/python2.7/macurl2path.pyt<module>s	*	

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].