config root man

Current Path : /usr/local/lib/python2.5/

FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64
Upload File :
Current File : //usr/local/lib/python2.5/urllib.pyc

hRc#@svdZddkZddkZddkZddkZddkZddklZdddddd	d
ddd
ddddddddddddddddddd gZ	d!Z
d"Zeid#jodd$k
lZlZngeid%jodd$klZlZn=eid&jodd$klZlZnd'Zd(Zeaeed)Zeeed*Zd+Zd,efd-YZhZdfd.YZdefd/YZead0Zead1Zea d2Z!ea"d3Z#d4fd5YZ$d6fd7YZ%d8e%fd9YZ&d:e%fd;YZ'd<e%fd=YZ(ye)Wne*j
od>Z+nXd?Z+d@Z,dAZ-ea.dBZ/ea0dCZ1ea2dDZ3ea4dEZ5ea6dFZ7ea8ddGZ9ea:dHZ;ea<dIZ=dJZ>ea?dKZ@dLZAeBdMeCdNDZDeDiEdOeCdNDdPZFdQZGdRZHhZIdSdTZJdUdVZKdWdXZLdYZMeiNdZjod[ZOd\ZPd]ZQn?eid%jod^ZRd_ZQd`ZPneMZQdaZPdbZSdcZTgddZUdeZVeWdfjoeVndS(gsOpen an arbitrary URL.

See the following document for more info on URLs:
"Names and Addresses, URIs, URLs, URNs, URCs", at
http://www.w3.org/pub/WWW/Addressing/Overview.html

See also the HTTP spec (from which the error codes are derived):
"HTTP - Hypertext Transfer Protocol", at
http://www.w3.org/pub/WWW/Protocols/

Related standards and specs:
- RFC1808: the "relative URL" spec. (authoritative status)
- RFC1738 - the "URL standard". (authoritative status)
- RFC1630 - the "URI spec". (informational status)

The object returned by URLopener().open(file) will differ per
protocol.  All you know is that is has methods read(), readline(),
readlines(), fileno(), close() and info().  The read*(), fileno()
and close() methods work like those of open files.
The info() method returns a mimetools.Message object which can be
used to query various info about the object, if available.
(mimetools.Message objects are queried with the getheader() method.)
iN(turljointurlopent	URLopenertFancyURLopenerturlretrievet
urlcleanuptquotet
quote_plustunquotetunquote_plust	urlencodeturl2pathnametpathname2urltsplittagt	localhosttthishostt	ftperrorstbasejointunwrapt	splittypet	splithostt	splitusertsplitpasswdt	splitportt
splitnportt
splitqueryt	splitattrt
splitvaluetsplitgophertypet
getproxiess1.17i
tmac(RRtnttriscoscCs
t|S(sOS-specific conversion from a relative URL of the 'file' scheme
        to a file system path; not recommended for general use.(R(tpathname((s"/usr/local/lib/python2.5/urllib.pyR4scCs
t|S(sOS-specific conversion from a file system path to a relative URL
        of the 'file' scheme; not recommended for general use.(R(R!((s"/usr/local/lib/python2.5/urllib.pyR9scCsr|dj	otd|}n!tpt}|ant}|djo|i|Sn|i||SdS(s.urlopen(url [, data]) -> open file-like objecttproxiesN(tNoneRt
_urlopenertopen(turltdataR"topener((s"/usr/local/lib/python2.5/urllib.pyRGs
	

cCs*tp
tanti||||S(N(R$Rtretrieve(R&tfilenamet
reporthookR'((s"/usr/local/lib/python2.5/urllib.pyRUs
cCstotindS(N(R$tcleanup(((s"/usr/local/lib/python2.5/urllib.pyRZstContentTooShortErrorcBseZdZRS(cCsti||||_dS(N(tIOErrort__init__tcontent(tselftmessageR0((s"/usr/local/lib/python2.5/urllib.pyR/`s(t__name__t
__module__R/(((s"/usr/local/lib/python2.5/urllib.pyR-_scBseZdZdZdeZddZdZdZ	dZ
dZddZddZ
dd	Zdddd
ZddZddZd
ZeedoddZndZdZdZdZddZRS(s,Class to open URLs.
    This is a class rather than just a subroutine because we may need
    more than one set of global protocol-specific options.
    Note -- this is a base class for those who don't want the
    automatic handling of errors type 302 (relocated) and 401
    (authorization needed).sPython-urllib/%scKs|djo
t}nt|dp
td||_|id|_|id|_d|ifg|_	g|_
ti|_
d|_t|_dS(Nthas_keysproxies must be a mappingtkey_filet	cert_files
User-Agent(R#RthasattrtAssertionErrorR"tgetR6R7tversiont
addheaderst_URLopener__tempfilestostunlinkt_URLopener__unlinkt	tempcachetftpcache(R1R"tx509((s"/usr/local/lib/python2.5/urllib.pyR/rs

			cCs|idS(N(tclose(R1((s"/usr/local/lib/python2.5/urllib.pyt__del__scCs|idS(N(R,(R1((s"/usr/local/lib/python2.5/urllib.pyRDscCso|ioFx8|iD]-}y|i|Wqtj
oqXqW|i2n|io|iindS(N(R=R@tOSErrorRAtclear(R1tfile((s"/usr/local/lib/python2.5/urllib.pyR,s

	
cGs|ii|dS(sdAdd a header to be used by the HTTP interface only
        e.g. u.addheader('Accept', 'sound/basic')N(R<tappend(R1targs((s"/usr/local/lib/python2.5/urllib.pyt	addheaderscCstt|}|ioF||ijo6|i|\}}t|d}t|||Snt|\}}|p
d}n||ijoA|i|}t|\}}	t|	\}
}|
|f}nd}d|}||_	|i
dd}t||p2|o|i|||SqC|i
||Sny>|djot|||Snt||||SWn4tij
o%}
td|
ftidnXdS(	s6Use URLopener().open(file) instead of open(file, 'r').trbRHtopen_t-t_ssocket erroriN(RttoBytesRAR%t
addinfourlRR"RR#ttypetreplaceR8topen_unknown_proxytopen_unknowntgetattrtsocketterrorR.tsystexc_info(R1tfullurlR'R*theaderstfpturltypeR&tproxyt	proxyhostthosttselectortnametmsg((s"/usr/local/lib/python2.5/urllib.pyR%s6


	
cCs(t|\}}tdd|fdS(s/Overridable interface to open unknown URL type.s	url errorsunknown url typeN(RR.(R1R[R'RRR&((s"/usr/local/lib/python2.5/urllib.pyRUscCs,t|\}}tdd||fdS(s/Overridable interface to open unknown URL type.s	url errorsinvalid proxy for %sN(RR.(R1R_R[R'RRR&((s"/usr/local/lib/python2.5/urllib.pyRTscCstt|}|io||ijo|i|Snt|\}}|djom|p
|djoXy<|i|}|i}~tt|d|fSWqt	j
o	}	qXn|i
||}|i}
|ot
|d}nddk}t|\}
}t|pd\}
}t|pd\}}
t
|pd\}}
tii|d}|i|\}}|ii|ti|d}||
f}|idj	o||i|<nd
}d}d	}d	}|o5d
|
jot|
d}n||||nxf|i|}|djoPn|t|7}|i||d7}|o||||q9q9|i|i~~|d	jo*||jotd||f|n|S(stretrieve(url) returns (filename, headers) for a local object
        or (tempfilename, headers) for a remote object.RHitwbiNtiiiscontent-lengthsContent-Lengths1retrieval incomplete: got only %i out of %i bytesi (RRPRARR#topen_local_filetinfoRRR.R%ttempfileRRR>tpathtsplitexttmkstempR=RItfdopentinttreadtlentwriteRDR-(R1R&R*R+R'RRturl1R]thdrsRdR\ttfpRitgarbageRjtsuffixtfdtresulttbstsizeRotblocknumtblock((s"/usr/local/lib/python2.5/urllib.pyR)sj"	





cCsXddk}d}d}t|toEt|\}}|o"t|\}}t|}n|}n|\}}t|\}}t|\}	}
|
}d}|	idjo
d}net|
\}}
|ot|\}}n|od|	||
f}nt	|o
|}n|p
t
dn|o%ddk}|i|i
}nd}|o%ddk}|i|i
}
nd}
|i|}|dj	o>|id||idd	|id
dt|n|id||o|id
d|n|
o|idd|
n|o|id|nx|iD]}|i|qoW|i|dj	o|i|n|i\}}}|djo
t
dn|i}|djot||d|SnG|djo|i|||||Sn|i||||||SdS(sUse HTTP protocol.iNthttps	%s://%s%ss
http errors
no host giventPOSTsContent-Types!application/x-www-form-urlencodedsContent-Lengths%dtGETsProxy-AuthorizationsBasic %st
AuthorizationtHostshttp protocol errorisgot a bad status lineishttp:(s
http errors
no host given(shttp protocol errorisgot a bad status lineN(thttplibR#t
isinstancetstrRRRRtlowertproxy_bypassR.tbase64t	b64encodetstriptHTTPt
putrequestt	putheaderRpR<t
endheaderstsendtgetreplytgetfileRQt
http_error(R1R&R'Rtuser_passwdtproxy_passwdRaRbtrealhostR^trestRt
proxy_authtauththRJterrcodeterrmsgR\R]((s"/usr/local/lib/python2.5/urllib.pyt	open_httpsz












c
Csd|}t||oft||}|djo||||||}	n|||||||}	|	o|	Sqn|i|||||S(sHandle http errors.
        Derived class can override this, or provide specific handlers
        named http_error_DDD where DDD is the 3-digit error code.s
http_error_%dN(R8RVR#thttp_error_default(
R1R&R]RRR\R'RctmethodRx((s"/usr/local/lib/python2.5/urllib.pyRVs

cCs/|i}|itd|||fdS(s>Default error handler: close the connection and raise IOError.s
http errorN(RoRDR.(R1R&R]RRR\tvoid((s"/usr/local/lib/python2.5/urllib.pyRes
tsslcCsVddk}d}d}t|toEt|\}}|o"t|\}}t|}n|}n|\}}t|\}}t|\}	}
|
}d}|	idjo
d}nNt|
\}}
|ot|\}}n|od|	||
f}n|p
t	dn|o%ddk
}|i|i}nd}|o%ddk
}|i|i}
nd}
|i
|dd|id	|i}|dj	o>|id
||idd|id
dt|n|id||o|idd|n|
o|idd|
n|o|id|nx|iD]}|i|qmW|i|dj	o|i|n|i\}}}|djo
t	dn|i}|djot||d|SnG|djo|i|||||Sn|i||||||SdS(sUse HTTPS protocol.iNthttpss	%s://%s%sshttps errors
no host giveniR6R7R~sContent-Types!application/x-www-form-urlencodedsContent-Lengths%dRsProxy-AuthorizationsBasic %sRRshttp protocol errorsgot a bad status lineishttps:(shttps errors
no host given(shttp protocol errorisgot a bad status lineN(RR#RRRRRRRR.RRRtHTTPSR6R7RRRpR<RRRRRQR(R1R&R'RRRRaRbRR^RRRRRRJRRR\R]((s"/usr/local/lib/python2.5/urllib.pyt
open_httpsls~


	
	






cCst|tp
tdnddk}t|\}}|p
tdnt|}t|\}}t|\}}t|}|o%t|}|i|||}n|i	||}t
|td|S(	sUse Gopher protocol.sgopher errors;proxy support for gopher protocol currently not implementediNs
no host givensgopher:(sgopher errors;proxy support for gopher protocol currently not implemented(sgopher errors
no host given(RRR.t	gopherlibRRRRt
send_queryt
send_selectorRQt	noheaders(R1R&RRaRbRRtqueryR]((s"/usr/local/lib/python2.5/urllib.pytopen_gophers

cCs~t|tp
td
n|d djo?|dd!djo+|dd!idjo|i|Sn|i|Sd	S(s/Use local file or FTP depending on form of URL.s
file errors9proxy support for file protocol currently not implementedis//it/is
localhost/N(s
file errors9proxy support for file protocol currently not implemented(RRR.Rtopen_ftpRg(R1R&((s"/usr/local/lib/python2.5/urllib.pyt	open_files

?cCsddk}ddk}ddk}yddkl}Wn#tj
oddkl}nXt|\}}t|}yti	|}	Wn0t
j
o$}
t|
i|
i
|
inX|	i}|ii|	idt}|i|d}
|i|d|
pd||f}|pB|}|d d	jod
|}ntt|d||Snt|\}}|odti|ttfjoB|}|d d	jod
|}ntt|d||SntddS(sUse local file.iN(tStringIOtusegmtis6Content-Type: %s
Content-Length: %d
Last-modified: %s
s
text/plainiRsfile://RLslocal file errorsnot on local host(slocal file errorsnot on local host(t	mimetypest	mimetoolstemail.Utilst	cStringIORtImportErrorRRR>tstatRFR.terrnotstrerrorR*tst_sizetUtilst
formatdatetst_mtimetTruet
guess_typetMessageRQR%RRWt
gethostbynameRR(R1R&RRtemailRRaRHt	localnametstatsteRztmodifiedtmtypeR\turlfiletport((s"/usr/local/lib/python2.5/urllib.pyRgs@$ 		"cCst|tp
tdnddk}ddk}yddkl}Wn#tj
oddkl}nXt|\}}|p
tdnt	|\}}t
|\}}|ot|\}}	nd}	t
|}t
|pd}t
|	pd}	ti|}|pddk}
|
i}n
t|}t|\}}t
|}|id}|d |d}}
|o|d	o|d
}n|o|d	od|d	<n|||di|f}t|itjoPxM|iiD]8}||jo%|i|}|i|=|iqqWnyK||ijo#t||	||||i|<n|
p
d}nd}xP|D]H}t|\}}|id
jo|djo|i}qqW|i|i|
|\}}|i d|d	}d}|o|d|7}n|dj	o|d	jo|d|7}n|i!||}t"||d|SWn4t#j
o%}td|ft$i%dnXdS(sUse FTP protocol.s	ftp errors8proxy support for ftp protocol currently not implementediN(Rs
no host givenRfRiitDtIRRtatAtitdsftp:sContent-Type: %s
sContent-Length: %d
i(s	ftp errors8proxy support for ftp protocol currently not implemented(s	ftp errors
no host given(RRRRRR(&RRR.RRRRRRRRRR#RRWRtftplibtFTP_PORTRnRtsplittjoinRpRBtMAXFTPCACHEtkeysRDt
ftpwrapperRRtuppertretrfileRRRQRRYRZ(R1R&RRRRaRjRtusertpasswdRtattrstdirsRHtkeytktvRRtattrtvalueR]tretrlenRR\Rd((s"/usr/local/lib/python2.5/urllib.pyRs|





#

cCst|tp
tdnddk}yddkl}Wn#tj
oddkl}nXy|idd\}}Wntj
otdnX|p
d	}n|i	d
}|djo-d||jo||d}|| }nd
}g}|i
dtidti
ti|i
d||djoddk}	|	i|}n
t|}|i
dt||i
d
|i
|di|}||}
|i|
d}t|
||S(sUse "data" URL.s
data errors9proxy support for data protocol currently not implementediN(Rt,isbad data URLstext/plain;charset=US-ASCIIt;it=RfsDate: %ss%a, %d %b %Y %T GMTsContent-type: %sRsContent-Length: %ds
(s
data errors9proxy support for data protocol currently not implemented(s
data errorsbad data URL(RRR.RRRRRt
ValueErrortrfindRIttimetstrftimetgmtimeRtdecodestringRRpRRRQ(R1R&R'RRRRtsemitencodingRdRtfR\((s"/usr/local/lib/python2.5/urllib.pyt	open_data.sB




N(R3R4t__doc__R#R=t__version__R;R/RERDR,RKR%RURTR)RRRR8RWRRRRgRR(((s"/usr/local/lib/python2.5/urllib.pyRes,
				!?H	F				#	>cBseZdZdZdZddZdZddZddZ	ddZ
ddZdd	Zdd
Z
ddZddZdd
ZddZdZRS(s?Derived class with handlers for errors we can handle (perhaps).cOs2ti|||h|_d|_d|_dS(Nii
(RR/t
auth_cachettriestmaxtries(R1RJtkwargs((s"/usr/local/lib/python2.5/urllib.pyR/`s		cCst||d|S(s3Default error handling -- don't raise an exception.shttp:(RQ(R1R&R]RRR\((s"/usr/local/lib/python2.5/urllib.pyRfsc	Cs|id7_|io\|i|ijoIt|do
|i}n
|i}d|_|||dd|Sn|i||||||}d|_|S(s%Error 302 -- relocated (temporarily).ithttp_error_500iis)Internal Server Error: Redirect Recursion(RRR8RRtredirect_internal(	R1R&R]RRR\R'tmethRx((s"/usr/local/lib/python2.5/urllib.pythttp_error_302js
				c	Cswd|jo|d}n d|jo|d}ndS|i}|it|id||}|i|S(Ntlocationturit:(RoRDRRRR%(	R1R&R]RRR\R'tnewurlR((s"/usr/local/lib/python2.5/urllib.pyRzs


cCs|i||||||S(s*Error 301 -- also relocated (permanently).(R(R1R&R]RRR\R'((s"/usr/local/lib/python2.5/urllib.pythttp_error_301scCs|i||||||S(s;Error 303 -- also relocated (essentially identical to 302).(R(R1R&R]RRR\R'((s"/usr/local/lib/python2.5/urllib.pythttp_error_303scCsJ|djo |i||||||Sn|i|||||SdS(s1Error 307 -- relocated, but turn POST into error.N(R#RR(R1R&R]RRR\R'((s"/usr/local/lib/python2.5/urllib.pythttp_error_307s
 c
Csd|jo ti||||||n|d}ddk}|id|}	|	p ti||||||n|	i\}
}|
idjo ti||||||nd|id}|djot||||Snt|||||SdS(s_Error 401 -- authentication required.
        This function supports Basic authentication only.swww-authenticateiNs![ 	]*([^ 	]+)[ 	]+realm="([^"]*)"tbasictretry_t_basic_auth(	RRtretmatchtgroupsRRRR#RV(
R1R&R]RRR\R'tstuffRRtschemetrealmRc((s"/usr/local/lib/python2.5/urllib.pythttp_error_401s"


c
Csd|jo ti||||||n|d}ddk}|id|}	|	p ti||||||n|	i\}
}|
idjo ti||||||nd|id}|djot||||Snt|||||SdS(seError 407 -- proxy authentication required.
        This function supports Basic authentication only.sproxy-authenticateiNs![ 	]*([^ 	]+)[ 	]+realm="([^"]*)"Rtretry_proxy_R(	RRRRRRRRR#RV(
R1R&R]RRR\R'RRRRRRc((s"/usr/local/lib/python2.5/urllib.pythttp_error_407s"


cCst|\}}d||}|id}t|\}}	t|	\}	}
|	idd}|	|}	|i|	||\}}
|p|
pdSnt|dddt|
ddd|	}	d|	|
|id<|djo|i|Sn|i||SdS(Nshttp://R}t@itsafeRfR(RR"Rtfindtget_user_passwdR#RR%(R1R&RR'RaRbRR_R^R`t
proxyselectorRRR((s"/usr/local/lib/python2.5/urllib.pytretry_proxy_http_basic_auths

.
cCst|\}}d||}|id}t|\}}	t|	\}	}
|	idd}|	|}	|i|	||\}}
|p|
pdSnt|dddt|
ddd|	}	d|	|
|id<|djo|i|Sn|i||SdS(Nshttps://RR	iR
RfR(RR"RRRR#RR%(R1R&RR'RaRbRR_R^R`R
RRR((s"/usr/local/lib/python2.5/urllib.pytretry_proxy_https_basic_auths

.
c
Cst|\}}|idd}||}|i|||\}}|p|pdSnt|dddt|ddd|}d||}	|djo|i|	Sn|i|	|SdS(NR	iR
RfRshttp://(RRRR#RR%(
R1R&RR'RaRbRRRR((s"/usr/local/lib/python2.5/urllib.pytretry_http_basic_auths
.
c
Cst|\}}|idd}||}|i|||\}}|p|pdSnt|dddt|ddd|}d||}	|djo|i|	Sn|i|	|SdS(NR	iR
RfRshttps://(RRRR#RR%(
R1R&RR'RaRbRRRR((s"/usr/local/lib/python2.5/urllib.pytretry_https_basic_auths
.
icCs|d|i}||ijo$|o|i|=qH|i|Sn|i||\}}|p|o||f|i|<n||fS(NR	(RRtprompt_user_passwd(R1RaRtclear_cacheRRR((s"/usr/local/lib/python2.5/urllib.pyRsc	Cskddk}y@td||f}|id|||f}||fSWntj
oHdSnXdS(s#Override this in a GUI environment!iNsEnter username for %s at %s: s#Enter password for %s in %s at %s: (NN(tgetpasst	raw_inputtKeyboardInterruptR#(R1RaRRRR((s"/usr/local/lib/python2.5/urllib.pyR	s	
	N(R3R4RR/RR#RRRRRRRRRRRRR(((s"/usr/local/lib/python2.5/urllib.pyR]s 			


cCs$tdjotidantS(s8Return the IP address of the magic hostname 'localhost'.RN(t
_localhostR#RWR(((s"/usr/local/lib/python2.5/urllib.pyRs
cCs*tdjotitiantS(s*Return the IP address of the current host.N(t	_thishostR#RWRtgethostname(((s"/usr/local/lib/python2.5/urllib.pyR"s
cCs*tdjoddk}|iantS(s1Return the set of errors raised by the FTP class.iN(t
_ftperrorsR#Rt
all_errors(R((s"/usr/local/lib/python2.5/urllib.pyR*s

cCs}tdjolddk}yddkl}Wn#tj
oddkl}nX|i|datiintS(s)Return an empty mimetools.Message object.iN(Ri(	t
_noheadersR#RRRRRR]RD(RR((s"/usr/local/lib/python2.5/urllib.pyR3s
RcBs;eZdZdZdZdZdZdZRS(s;Class used by open_ftp() for cache of open FTP connections.cCs;||_||_||_||_||_|idS(N(RRRaRRtinit(R1RRRaRR((s"/usr/local/lib/python2.5/urllib.pyR/Fs					cCs~ddk}d|_|i|_|ii|i|i|ii|i|i	x!|i
D]}|ii|q`WdS(Nii(RtbusytFTPtftptconnectRaRtloginRRRtcwd(R1Rtdir((s"/usr/local/lib/python2.5/urllib.pyRNs	
c
Csddk}|i|djod}d}nd|}d}y|ii|Wn0|ij
o!|i|ii|nXd}|o~|ovy d|}|ii|}Wq|ij
o@}t	|d	 d
jo t
d|ftidqqXn|pA|iid|od
|}nd}|ii|}nd|_
t|did|i|dfS(NiRRsTYPE AisTYPE isRETR it550s	ftp errorisLIST tLISTRL(RR(RtendtransferR tvoidcmdRRR#tntransfercmdt
error_permRR.RYRZRtaddclosehooktmakefile(R1RHRRRtcmdtisdirtconntreason((s"/usr/local/lib/python2.5/urllib.pyRWs:





)	cCsI|ipdSnd|_y|iiWntj
onXdS(Ni(RR tvoidrespR(R1((s"/usr/local/lib/python2.5/urllib.pyR'us
	cCs8|iy|iiWntj
onXdS(N(R'R RDR(R1((s"/usr/local/lib/python2.5/urllib.pyRD~s

(R3R4RR/RRR'RD(((s"/usr/local/lib/python2.5/urllib.pyRCs						taddbasecBs)eZdZdZdZdZRS(s(Base class for addinfo and addclosehook.cCs||_|ii|_|ii|_t|ido|ii|_nt|ido|ii|_n
d|_t|ido9|ii|_t|ido|ii|_qndS(Nt	readlinestfilenocSsdS(N(R#(((s"/usr/local/lib/python2.5/urllib.pyt<lambda>st__iter__tnext(R]RotreadlineR8R3R4R6R7(R1R]((s"/usr/local/lib/python2.5/urllib.pyR/s	cCs d|iit||ifS(Ns<%s at %r whose fp = %r>(t	__class__R3tidR](R1((s"/usr/local/lib/python2.5/urllib.pyt__repr__scCsLd|_d|_d|_d|_|io|iind|_dS(N(R#RoR8R3R4R]RD(R1((s"/usr/local/lib/python2.5/urllib.pyRDs				
(R3R4RR/R;RD(((s"/usr/local/lib/python2.5/urllib.pyR2s		R+cBs eZdZdZdZRS(s*Class to add a close hook to an open file.cGs&ti||||_||_dS(N(R2R/t	closehookthookargs(R1R]R<R=((s"/usr/local/lib/python2.5/urllib.pyR/s	cCsAti||io&|i|id|_d|_ndS(N(R2RDR<R=R#(R1((s"/usr/local/lib/python2.5/urllib.pyRDs


	(R3R4RR/RD(((s"/usr/local/lib/python2.5/urllib.pyR+s	taddinfocBs eZdZdZdZRS(s.class to add an info() method to an open file.cCsti||||_dS(N(R2R/R\(R1R]R\((s"/usr/local/lib/python2.5/urllib.pyR/scCs|iS(N(R\(R1((s"/usr/local/lib/python2.5/urllib.pyRhs(R3R4RR/Rh(((s"/usr/local/lib/python2.5/urllib.pyR>s	RQcBs)eZdZdZdZdZRS(s9class to add info() and geturl() methods to an open file.cCs&ti||||_||_dS(N(R2R/R\R&(R1R]R\R&((s"/usr/local/lib/python2.5/urllib.pyR/s	cCs|iS(N(R\(R1((s"/usr/local/lib/python2.5/urllib.pyRhscCs|iS(N(R&(R1((s"/usr/local/lib/python2.5/urllib.pytgeturls(R3R4RR/RhR?(((s"/usr/local/lib/python2.5/urllib.pyRQs		cCsdS(Ni((tx((s"/usr/local/lib/python2.5/urllib.pyt_is_unicodescCs
t|tS(N(Rtunicode(R@((s"/usr/local/lib/python2.5/urllib.pyRAscCsXt|oGy|id}WqTtj
o!tdt|dqTXn|S(stoBytes(u"URL") --> 'URL'.tASCIIsURL s contains non-ASCII characters(RAtencodetUnicodeErrortrepr(R&((s"/usr/local/lib/python2.5/urllib.pyRPs
cCsn|i}|d djo(|ddjo|dd!i}n|d djo|di}n|S(s8unwrap('<URL:type://host/path>') --> 'type://host/path'.it<it>isURL:(R(R&((s"/usr/local/lib/python2.5/urllib.pyRs"cCs}tdjoddk}|idanti|}|o1|id}|i|t|dfSnd|fS(s:splittype('type:opaquestring') --> 'type', 'opaquestring'.iNs
^([^/:]+):i(t	_typeprogR#RtcompileRtgroupRRp(R&RRR((s"/usr/local/lib/python2.5/urllib.pyRs
"cCs`tdjoddk}|idanti|}|o|iddSnd|fS(s;splithost('//host[:port]/path') --> 'host[:port]', '/path'.iNs^//([^/?]*)(.*)$ii(t	_hostprogR#RRJRRK(R&RR((s"/usr/local/lib/python2.5/urllib.pyRs
cCsitdjoddk}|idanti|}|ott|iddSnd|fS(sJsplituser('user[:passwd]@host[:port]') --> 'user[:passwd]', 'host[:port]'.iNs^(.*)@(.*)$ii(t	_userprogR#RRJRtmapRRK(RaRR((s"/usr/local/lib/python2.5/urllib.pyRs
cCs`tdjoddk}|idanti|}|o|iddSn|dfS(s/splitpasswd('user:passwd') -> 'user', 'passwd'.iNs^([^:]*):(.*)$ii(t_passwdprogR#RRJRRK(RRR((s"/usr/local/lib/python2.5/urllib.pyRs
cCs`tdjoddk}|idanti|}|o|iddSn|dfS(s*splitport('host:port') --> 'host', 'port'.iNs^(.*):([0-9]+)$ii(t	_portprogR#RRJRRK(RaRR((s"/usr/local/lib/python2.5/urllib.pyR+s
cCstdjoddk}|idanti|}|of|idd\}}y$|p
tdnt|}Wntj
o
d}nX||fSn||fS(sSplit host and port, returning numeric port.
    Return given default port if no ':' found; defaults to -1.
    Return numerical port if a valid number are found after ':'.
    Return None if ':' but not a valid number.iNs^(.*):(.*)$iis	no digits(t
_nportprogR#RRJRRKRRn(RatdefportRRRtnport((s"/usr/local/lib/python2.5/urllib.pyR7s

cCs`tdjoddk}|idanti|}|o|iddSn|dfS(s/splitquery('/path?query') --> '/path', 'query'.iNs^(.*)\?([^?]*)$ii(t
_queryprogR#RRJRRK(R&RR((s"/usr/local/lib/python2.5/urllib.pyRMs
cCs`tdjoddk}|idanti|}|o|iddSn|dfS(s)splittag('/path#tag') --> '/path', 'tag'.iNs^(.*)#([^#]*)$ii(t_tagprogR#RRJRRK(R&RR((s"/usr/local/lib/python2.5/urllib.pyR
Ys
cCs!|id}|d|dfS(sksplitattr('/path;attr1=value1;attr2=value2;...') ->
        '/path', ['attr1=value1', 'attr2=value2', ...].Rii(R(R&twords((s"/usr/local/lib/python2.5/urllib.pyRdscCs`tdjoddk}|idanti|}|o|iddSn|dfS(s-splitvalue('attr=value') --> 'attr', 'value'.iNs^([^=]*)=(.*)$ii(t
_valueprogR#RRJRRK(RRR((s"/usr/local/lib/python2.5/urllib.pyRks
cCs?|d djo$|dd!o|d|dfSnd|fS(s2splitgophertype('/Xselector') --> 'X', 'selector'.iRiN(R#(Rb((s"/usr/local/lib/python2.5/urllib.pyRvsccs)x"|]}d|t|fVqWdS(s%02xN(tchr(t.0R((s"/usr/local/lib/python2.5/urllib.pys	<genexpr>|s	iccs)x"|]}d|t|fVqWdS(s%02XN(RX(RYR((s"/usr/local/lib/python2.5/urllib.pys	<genexpr>}s	c	Cs|id}xtdt|D]}||}yt|d |d||<Wq%tj
od|||<q%tj
o,tt|d d|d||<q%Xq%Wdi|S(s"unquote('abc%20def') -> 'abc def'.t%iiiRf(	RtxrangeRpt	_hextochrtKeyErrortUnicodeDecodeErrortunichrRnR(tstresRtitem((s"/usr/local/lib/python2.5/urllib.pyRs
.cCs|idd}t|S(s%unquote('%7e/abc+def') -> '~/abc def't+t (RSR(R`((s"/usr/local/lib/python2.5/urllib.pyR	ssAABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_.-RcCs|tf}yt|}Wnrtj
of|t7}h}xBtdD]4}t|}||jo|pd|||<qHW|t|<nXt|i|}di|S(squote('abc def') -> 'abc%20def'

    Each part of a URL, e.g. the path info, the query, etc., has a
    different set of reserved characters that must be quoted.

    RFC 2396 Uniform Resource Identifiers (URI): Generic Syntax lists
    the following reserved characters.

    reserved    = ";" | "/" | "?" | ":" | "@" | "&" | "=" | "+" |
                  "$" | ","

    Each of these characters is reserved in some component of a URL,
    but not necessarily in all of them.

    By default, the quote function is intended for quoting the path
    section of a URL.  Thus, it will not encode '/'.  This character
    is reserved, but in typical usage the quote function is being
    called on a path where the existing slash characters are used as
    reserved characters.
    is%%%02XRf(talways_safet	_safemapsR]trangeRXRNt__getitem__R(R`R
tcachekeytsafe_mapRtcRa((s"/usr/local/lib/python2.5/urllib.pyRs

&RfcCsAd|jo't||d}|iddSnt||S(s9Quote the query fragment of a URL; replacing ' ' with '+'RdRc(RRS(R`R
((s"/usr/local/lib/python2.5/urllib.pyRs
ic

Cst|do|i}nhy0t|ot|dto
tnWn4tj
o(ti\}}}td|nXg}|pTxl|D]E\}}tt	|}tt	|}|i
|d|qWnx|D]\}}tt	|}t|t	o%t|}|i
|d|qt|o1t|idd}|i
|d|qyt|}Wn:tj
o.tt	|}|i
|d|qXx/|D]'}	|i
|dtt	|	qWqWdi
|S(svEncode a sequence of two-element tuples or dictionary into a URL query string.

    If any values in the query arg are sequences and doseq is true, each
    sequence element is converted to a separate parameter.

    If the query arg is a sequence of two-element tuples, the order of the
    parameters in the output will match the order of parameters in the
    input.
    titemsis1not a valid non-string sequence or mapping objectRRCRSt&(R8RlRpRttuplet	TypeErrorRYRZRRRIRARDR(
RtdoseqttytvattbtlRRR@telt((s"/usr/local/lib/python2.5/urllib.pyR
sB"
)cCs`h}xStiiD]B\}}|i}|o#|ddjo|||d <qqW|S(sReturn a dictionary of scheme -> proxy server URL mappings.

    Scan the environment for variables named <scheme>_proxy;
    this seems to be the standard convention.  If you need a
    different way, you can pass a proxies dictionary to the
    [Fancy]URLopener constructor.

    it_proxy(R>tenvironRlR(R"RcR((s"/usr/local/lib/python2.5/urllib.pytgetproxies_environments	tdarwinc
Csyddk}Wntj
ohSnXy|i}Wn|ij
ohSnXh}d|joD|do9y|d}Wn|ij
oqXd||d<n|S(sReturn a dictionary of scheme -> proxy server URL mappings.

        By convention the mac uses Internet Config to store
        proxies.  An HTTP proxy, for instance, is stored under
        the HttpProxy key.

        iNtUseHTTPProxyt
HTTPProxyHosts	http://%sR}(ticRtICRX(R|tconfigR"R((s"/usr/local/lib/python2.5/urllib.pytgetproxies_internetconfigs 		cCsdS(Ni((R@((s"/usr/local/lib/python2.5/urllib.pyR.scCstptS(N(RxR(((s"/usr/local/lib/python2.5/urllib.pyR1sc	Csnh}yddk}Wntj
o|SnXy|i|id}|i|dd}|ot|i|dd}d|josx|idD][}|idd	\}}ddk}|id
|pd||f}n|||<qWq@|d d
jo||d<q@d||d<d||d<n|i	Wnt
ttfj
onX|S(sxReturn a dictionary of scheme -> proxy server URL mappings.

        Win32 uses the registry to store proxies.

        iNs;Software\Microsoft\Windows\CurrentVersion\Internet SettingstProxyEnableitProxyServerRRis^([^/:]+)://s%s://%sishttp:R}s	http://%ssftp://%sR (
t_winregRtOpenKeytHKEY_CURRENT_USERtQueryValueExRRRRtClosetWindowsErrorRRo(	R"RtinternetSettingstproxyEnabletproxyServertptprotocoltaddressR((s"/usr/local/lib/python2.5/urllib.pytgetproxies_registry5s:			

cCstptS(sReturn a dictionary of scheme -> proxy server URL mappings.

        Returns settings gathered from the environment, if specified,
        or the registry.

        (RxR(((s"/usr/local/lib/python2.5/urllib.pyRbsc
Cs`yddk}ddk}Wntj
odSnXyK|i|id}|i|dd}t|i|dd}Wntj
odSnX|p|odSnt|\}}|g}y1t	i
|}||jo|i|nWnt	ij
onXy1t	i
|}	|	|jo|i|	nWnt	ij
onX|id}d}
xi|
t|joU||
djo6dd	t	it	i
t	ig||
|
d
+n|
d
7}
qzWxv|D]n}|idd}|id
d}|idd}x/|D]'}|i|||iod
Sq-q-WqWdS(Niis;Software\Microsoft\Windows\CurrentVersion\Internet SettingsRt
ProxyOverrideRs<local>Rs	127.0.0.1it.s\.t*s.*t?(RRRRRRRRRRWRRIRXtgetfqdnRRpRRSRR(
RaRRRRt
proxyOverridetrawHostRtaddrtfqdnRttesttval((s"/usr/local/lib/python2.5/urllib.pyRksf			
		

	!cCsdS(Ni((Ra((s"/usr/local/lib/python2.5/urllib.pyRscCsd}x$tdD]}|t|}qW|d}ti}t|}t|}ti}||jo	dGHnt|GHt|GHt|GHt||dGdGHdS(NRfiisWrong!itsec(RgRXRRRRFtround(R`Rtt0tqstuqstt1((s"/usr/local/lib/python2.5/urllib.pyttest1s


	cCsd|||fGHdS(Ns0Block number: %d, Block size: %d, Total size: %d((R{t	blocksizet	totalsize((s"/usr/local/lib/python2.5/urllib.pyR+sc	Cs9|p:dddddg}ttdo|idqAnzx|D]}dG|GdGHt|dt\}}|GH|o6d
GHx%|iD]}|dG||GHqWd
GHnt|d}|i}~d
|jo(t	i
dd}|i|d
}n|GHd\}}qKWddGHWdtXdS(Ns/etc/passwdsfile:/etc/passwdsfile://localhost/etc/passwdsftp://ftp.gnu.org/pub/READMEs http://www.python.org/index.htmlRs!https://synergy.as.cmu.edu/~geek/RNi
s======RRLs
Rfi(s
----------s
----------(NN(
R8RRIRR#R+RR%Rotstringt	maketranst	translateR(RJR&tfnRRR]R'ttable((s"/usr/local/lib/python2.5/urllib.pyRs<	

	

c	Cs!ddk}ddk}y#|i|idd\}}Wn&|ij
o}|GHdGHdSnXd}xR|D]J\}}|djo|d}n|djodGHd	Gd
GHdSqqqqW|o&|djotnt|n2|p	dGHnx|D]}t|iGqWdS(NiitthsUse -h for helpis-ts-hs&Usage: python urllib.py [-t] [url ...]s-t runs self-test;s'otherwise, contents of urls are printed(tgetoptRYtargvRXRRRRo(	RRYtoptsRJRdtttoRR&((s"/usr/local/lib/python2.5/urllib.pytmains4#	


	t__main__(XRRRWR>RRYturlparseRRt__all__RRRctmacurl2pathRRt
nturl2patht
rourl2pathR#R$RRRR.R-RBRRRRRRRRRRRR2R+R>RQRBt	NameErrorRARPRRIRRLRRMRRORRPRRQRRTRRUR
RRWRRtdictRgR\tupdateRR	ReRfRRR
RxtplatformRRRRRR+RRR3(((s"/usr/local/lib/python2.5/urllib.pys<module>s		
					B
				
										
	"@			
	-		
=			!	


Man Man