403Webshell
Server IP : 182.53.201.61  /  Your IP : 216.73.217.175
Web Server : Apache/2.2.15 (Fedora)
System : Linux km10.dyndns.org 2.6.31.5-127.fc12.i686.PAE #1 SMP Sat Nov 7 21:25:57 EST 2009 i686
User : apache ( 48)
PHP Version : 5.3.3
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /proc/4413/cwd/usr/lib/python2.6/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /proc/4413/cwd/usr/lib/python2.6/urllib.pyc
ɎJc#@sdZddkZddkZddkZddkZddkZddklZddk	Z	dddddd	d
ddd
ddddddddddddddddddgZ
d Zd!Zei
d"jodd#klZlZngei
d$jodd#klZlZn=ei
d%jodd#klZlZnd&Zd'Zeaeed(Zeeed)Zd*ZyddkZWn
eZnXeZd+efd,YZhZdfd-YZdefd.YZ ea!d/Z"ea#d0Z$ea%d1Z&ea'd2Z(d3fd4YZ)d5fd6YZ*d7e*fd8YZ+d9e*fd:YZ,d;e*fd<YZ-ye.Wne/j
od=Z0nXd>Z0d?Z1d@Z2ea3dAZ4ea5dBZ6ea7dCZ8ea9dDZ:ea;dEZ<ea=ddFZ>ea?dGZ@eaAdHZBdIZCeaDdJZEeFdKeGdLDZHeHiIdMeGdLDdNZJdOZKdPZLhZMdQdRZNdSdTZOdUdVZPdWZQdXZReiSdYjoCdZZTd[ZUd\ZVd]ZWd^ZXd_ZYd`ZZnEei
d$jo(daZ[dbZZdcZ\ddZYn
eQZZeRZYdeZ]dfZ^gdgZ_dhZ`eadijoe`ndS(jsOpen 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
splitvaluet
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/lib/python2.6/urllib.pyR5scCs
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/lib/python2.6/urllib.pyR:scCsddkl}tiddd|dj	otd|}n!tpt}|ant}|djo|i|S|i||SdS(s=Create a file-like object for the specified URL to read from.i(twarnpy3ksMurllib.urlopen() has been removed in Python 3.0 in favor of urllib2.urlopen()t
stacklevelitproxiesN(twarningsR!tNoneRt
_urlopenertopen(turltdataR#R!topener((s/usr/lib/python2.6/urllib.pyRHs
	

cCs*tp
tanti||||S(N(R&Rtretrieve(R(tfilenamet
reporthookR)((s/usr/lib/python2.6/urllib.pyRZs
cCstotindS(N(R&tcleanup(((s/usr/lib/python2.6/urllib.pyR_stContentTooShortErrorcBseZdZRS(cCsti||||_dS(N(tIOErrort__init__tcontent(tselftmessageR2((s/usr/lib/python2.6/urllib.pyR1ms(t__name__t
__module__R1(((s/usr/lib/python2.6/urllib.pyR/lscBseZdZdZdeZddZdZdZ	dZ
dZddZddZ
dd	Zdddd
ZddZddZd
ZeoddZndZdZdZddZRS(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#tgetR8R9tversiont
addheaderst_URLopener__tempfilestostunlinkt_URLopener__unlinkt	tempcachetftpcache(R3R#tx509((s/usr/lib/python2.6/urllib.pyR1s

			cCs|idS(N(tclose(R3((s/usr/lib/python2.6/urllib.pyt__del__scCs|idS(N(R.(R3((s/usr/lib/python2.6/urllib.pyRFscCso|ioFx8|iD]-}y|i|Wqtj
oqXqW|i2n|io|iindS(N(R?RBtOSErrorRCtclear(R3tfile((s/usr/lib/python2.6/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(R3targs((s/usr/lib/python2.6/urllib.pyt	addheaderscCstt|}|ioC||ijo3|i|\}}t|d}t|||St|\}}|p
d}n||ijoA|i|}t|\}}	t|	\}
}|
|f}nd}d|}||_	|i
dd}t||p/|o|i|||S|i
||Sny;|djot|||St||||SWn4tij
o%}
td|
ftidnXdS(	s6Use URLopener().open(file) instead of open(file, 'r').trbRJtopen_t-t_ssocket erroriN(RttoBytesRCR't
addinfourlRR#RR%ttypetreplaceR:topen_unknown_proxytopen_unknowntgetattrtsocketterrorR0tsystexc_info(R3tfullurlR)R,theaderstfpturltypeR(tproxyt	proxyhostthosttselectortnametmsg((s/usr/lib/python2.6/urllib.pyR's6


	
cCs(t|\}}tdd|fdS(s/Overridable interface to open unknown URL type.s	url errorsunknown url typeN(RR0(R3R]R)RTR(((s/usr/lib/python2.6/urllib.pyRWscCs,t|\}}tdd||fdS(s/Overridable interface to open unknown URL type.s	url errorsinvalid proxy for %sN(RR0(R3RaR]R)RTR(((s/usr/lib/python2.6/urllib.pyRVscCstt|}|io||ijo|i|St|\}}|djom|p
|djoXy<|i|}|i}~tt|d|fSWqt	j
o	}	qXn|i
||}z|i}
|ot
|d}nddk}t|\}
}t|pd\}
}t|pd\}}
t
|pd\}}
tii|d}|i|\}}|ii|ti|d}z||
f}|idj	o||i|<nd
}d}d	}d	}|o5d
|
jot|
d}n||||nxf|i|}|djoPn|t|7}|i||d7}|o||||q<q<Wd|iXWd|iX~~|d	jo*||jotd||f|n|S(stretrieve(url) returns (filename, headers) for a local object
        or (tempfilename, headers) for a remote object.RJitwbiNtiiiscontent-lengthsContent-Lengths1retrieval incomplete: got only %i out of %i bytesi (RRRRCRR%topen_local_filetinfoRRR0R'ttempfileRRR@tpathtsplitexttmkstempR?RKtfdopentinttreadtlentwriteRFR/(R3R(R,R-R)RTturl1R_thdrsRfR^ttfpRktgarbageRltsuffixtfdtresulttbstsizeRqtblocknumtblock((s/usr/lib/python2.6/urllib.pyR+sn"	



cCs{ddk}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\}}}|i}|djo"|o|int
dnd|jo
djnot||d||S|djo|i|||||S|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 lineii,shttp:(s
http errors
no host given(shttp protocol errorisgot a bad status lineN(thttplibR%t
isinstancetstrRRRRtlowertproxy_bypassR0tbase64t	b64encodetstriptHTTPt
putrequestt	putheaderRrR>t
endheaderstsendtgetreplytgetfileRFRSt
http_error(R3R(R)Rtuser_passwdtproxy_passwdRcRdtrealhostR`trestRt
proxy_authtauththRLterrcodeterrmsgR^R_((s/usr/lib/python2.6/urllib.pyt	open_https~











c
Csd|}t||oct||}|djo||||||}	n|||||||}	|	o|	Sn|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(R:RXR%thttp_error_default(
R3R(R_RRR^R)RetmethodRz((s/usr/lib/python2.6/urllib.pyRjs

	cCs/|i}|itd|||fdS(s>Default error handler: close the connection and raise IOError.s
http errorN(RqRFR0(R3R(R_RRR^tvoid((s/usr/lib/python2.6/urllib.pyRys
cCsyddk}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\}}}|i}|djo"|o|int	dnd|jo
djnot||d||S|djo|i|||||S|i||||||SdS(sUse HTTPS protocol.iNthttpss	%s://%s%sshttps errors
no host giveniR8R9RsContent-Types!application/x-www-form-urlencodedsContent-Lengths%dRsProxy-AuthorizationsBasic %sRRshttp protocol errorsgot a bad status lineii,shttps:(shttps errors
no host given(shttp protocol errorisgot a bad status lineN(RR%RRRRRRRR0RRRtHTTPSR8R9RRRrR>RRRRRFRSR(R3R(R)RRRRcRdRR`RRRRRRLRRR^R_((s/usr/lib/python2.6/urllib.pyt
open_httpss


	
	





cCs{t|tp
td
n|d djo<|dd!djo(|dd!idjo|i|S|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(RRR0Rtopen_ftpRi(R3R(((s/usr/lib/python2.6/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}|p?|}|d d	jod
|}ntt|d||St|\}}|oati|ttfjo?|}|d d	jod
|}ntt|d||StddS(sUse local file.iN(tStringIOtusegmtis6Content-Type: %s
Content-Length: %d
Last-modified: %s
s
text/plainiRsfile://RNslocal file errorsnot on local host(slocal file errorsnot on local host(t	mimetypest	mimetoolstemail.utilst	cStringIORtImportErrorRRR@tstatRHR0terrnotstrerrorR,tst_sizetutilst
formatdatetst_mtimetTruet
guess_typetMessageRSR'RRYt
gethostbynameRR(R3R(RRtemailRRcRJt	localnametstatsteR|tmodifiedtmtypeR^turlfiletport((s/usr/lib/python2.6/urllib.pyRis@$ 		"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 givenRhRiitDtIRTtatAtitdsftp:sContent-Type: %s
sContent-Length: %d
i(s	ftp errors8proxy support for ftp protocol currently not implemented(s	ftp errors
no host given(RRRRRR(&RRR0RRRRRRRRRR%RRYRtftplibtFTP_PORTRpRtsplittjoinRrRDtMAXFTPCACHEtkeysRFt
ftpwrapperRRtuppertretrfileRRRSRR[R\(R3R(RRRRcRlRtusertpasswdRtattrstdirsRJtkeytktvRTtattrtvalueR_tretrlenRR^Rf((s/usr/lib/python2.6/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=RhsDate: %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(RRR0RRRRRt
ValueErrortrfindRKttimetstrftimetgmtimeRtdecodestringRRrRRRS(R3R(R)RRRTtsemitencodingRfRtfR^((s/usr/lib/python2.6/urllib.pyt	open_data4sB




N(R5R6t__doc__R%R?t__version__R=R1RGRFR.RMR'RWRVR+RRRt	_have_sslRRRiRR(((s/usr/lib/python2.6/urllib.pyRrs*
				!CK	J			#	>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
(RR1t
auth_cachettriestmaxtries(R3RLtkwargs((s/usr/lib/python2.6/urllib.pyR1fs		cCst||d||S(s3Default error handling -- don't raise an exception.shttp:(RS(R3R(R_RRR^((s/usr/lib/python2.6/urllib.pyRlsc	Cs|id7_|ioY|i|ijoFt|do
|i}n
|i}d|_|||dd|S|i||||||}d|_|S(s%Error 302 -- relocated (temporarily).ithttp_error_500iis)Internal Server Error: Redirect Recursion(RRR:RRtredirect_internal(	R3R(R_RRR^R)tmethRz((s/usr/lib/python2.6/urllib.pythttp_error_302ps
				c	Cswd|jo|d}n d|jo|d}ndS|i}|it|id||}|i|S(Ntlocationturit:(RqRFRRTR'(	R3R(R_RRR^R)tnewurlR((s/usr/lib/python2.6/urllib.pyRs


cCs|i||||||S(s*Error 301 -- also relocated (permanently).(R(R3R(R_RRR^R)((s/usr/lib/python2.6/urllib.pythttp_error_301scCs|i||||||S(s;Error 303 -- also relocated (essentially identical to 302).(R(R3R(R_RRR^R)((s/usr/lib/python2.6/urllib.pythttp_error_303scCsG|djo|i||||||S|i|||||SdS(s1Error 307 -- relocated, but turn POST into error.N(R%RR(R3R(R_RRR^R)((s/usr/lib/python2.6/urllib.pythttp_error_307s
c
Csd|jo ti||||||n|d}ddk}|id|}	|	p ti||||||n|	i\}
}|
idjo ti||||||nd|id}|djot||||St|||||SdS(s_Error 401 -- authentication required.
        This function supports Basic authentication only.swww-authenticateiNs![ 	]*([^ 	]+)[ 	]+realm="([^"]*)"tbasictretry_t_basic_auth(	RRtretmatchtgroupsRRTR%RX(
R3R(R_RRR^R)tstuffRRtschemetrealmRe((s/usr/lib/python2.6/urllib.pythttp_error_401s"


c
Csd|jo ti||||||n|d}ddk}|id|}	|	p ti||||||n|	i\}
}|
idjo ti||||||nd|id}|djot||||St|||||SdS(seError 407 -- proxy authentication required.
        This function supports Basic authentication only.sproxy-authenticateiNs![ 	]*([^ 	]+)[ 	]+realm="([^"]*)"Rtretry_proxy_R(	RRRRRRRTR%RX(
R3R(R_RRR^R)RRRRRRe((s/usr/lib/python2.6/urllib.pythttp_error_407s"


cCst|\}}d||}|id}t|\}}	t|	\}	}
|	idd}|	|}	|i|	||\}}
|p|
pdSt|dddt|
ddd|	}	d|	|
|id<|djo|i|S|i||SdS(Nshttp://Rt@itsafeRhR(RR#Rtfindtget_user_passwdR%RR'(R3R(RR)RcRdRRaR`Rbt
proxyselectorRRR((s/usr/lib/python2.6/urllib.pytretry_proxy_http_basic_auths

.
cCst|\}}d||}|id}t|\}}	t|	\}	}
|	idd}|	|}	|i|	||\}}
|p|
pdSt|dddt|
ddd|	}	d|	|
|id<|djo|i|S|i||SdS(Nshttps://RRiRRhR(RR#RRRR%RR'(R3R(RR)RcRdRRaR`RbR	RRR((s/usr/lib/python2.6/urllib.pytretry_proxy_https_basic_auths

.
c
Cst|\}}|idd}||}|i|||\}}|p|pdSt|dddt|ddd|}d||}	|djo|i|	S|i|	|SdS(NRiRRhRshttp://(RRRR%RR'(
R3R(RR)RcRdRRRR((s/usr/lib/python2.6/urllib.pytretry_http_basic_auths
.
c
Cst|\}}|idd}||}|i|||\}}|p|pdSt|dddt|ddd|}d||}	|djo|i|	S|i|	|SdS(NRiRRhRshttps://(RRRR%RR'(
R3R(RR)RcRdRRRR((s/usr/lib/python2.6/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(R3RcRtclear_cacheRRR((s/usr/lib/python2.6/urllib.pyRsc	Cshddk}y@td||f}|id|||f}||fSWntj
o	HdSXdS(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%(R3RcRRRR((s/usr/lib/python2.6/urllib.pyRs	
	N(R5R6RR1RR%RRRRRRRR
RRR
RR(((s/usr/lib/python2.6/urllib.pyRcs 			


cCs$tdjotidantS(s8Return the IP address of the magic hostname 'localhost'.RN(t
_localhostR%RYR(((s/usr/lib/python2.6/urllib.pyR s
cCs*tdjotitiantS(s*Return the IP address of the current host.N(t	_thishostR%RYRtgethostname(((s/usr/lib/python2.6/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/lib/python2.6/urllib.pyR0s

cCs}tdjolddk}yddkl}Wn#tj
oddkl}nX|i|datiintS(s)Return an empty mimetools.Message object.iN(Ri(	t
_noheadersR%RRRRRR_RF(RR((s/usr/lib/python2.6/urllib.pyt	noheaders9s
RcBsAeZdZeidZdZdZdZdZ	RS(s;Class used by open_ftp() for cache of open FTP connections.cCsD||_||_||_||_||_||_|idS(N(RRRcRRttimeouttinit(R3RRRcRRR((s/usr/lib/python2.6/urllib.pyR1Ls						cCsddk}d|_|i|_|ii|i|i|i|ii|i	|i
x!|iD]}|ii|qfWdS(Nii(
RtbusytFTPtftptconnectRcRRtloginRRRtcwd(R3Rtdir((s/usr/lib/python2.6/urllib.pyRVs	
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|p|iid|o|ii
}zOy|ii|Wn4|ij
o%}t
d|ftidnXWd|ii|Xd
|}nd}|ii|}nd|_t|did|i|dfS(NiRRsTYPE AisTYPE isRETR it550s	ftp errorisLIST tLISTRN(RR(RtendtransferRtvoidcmdRRR%tntransfercmdt
error_permRR0R[R\tpwdR!Rtaddclosehooktmakefile(	R3RJRTRtcmdtisdirtconntreasonR)((s/usr/lib/python2.6/urllib.pyR_sH





)%	cCsF|ipdSd|_y|iiWntj
onXdS(Ni(RRtvoidrespR(R3((s/usr/lib/python2.6/urllib.pyR%s
	cCs8|iy|iiWntj
onXdS(N(R%RRFR(R3((s/usr/lib/python2.6/urllib.pyRFs

(
R5R6RRYt_GLOBAL_DEFAULT_TIMEOUTR1RRR%RF(((s/usr/lib/python2.6/urllib.pyRIs				(		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/lib/python2.6/urllib.pyt<lambda>st__iter__tnext(R_RqtreadlineR:R3R4R6R7(R3R_((s/usr/lib/python2.6/urllib.pyR1s	cCs d|iit||ifS(Ns<%s at %r whose fp = %r>(t	__class__R5tidR_(R3((s/usr/lib/python2.6/urllib.pyt__repr__scCsLd|_d|_d|_d|_|io|iind|_dS(N(R%RqR8R3R4R_RF(R3((s/usr/lib/python2.6/urllib.pyRFs				
(R5R6RR1R;RF(((s/usr/lib/python2.6/urllib.pyR2s		R*cBs eZdZdZdZRS(s*Class to add a close hook to an open file.cGs&ti||||_||_dS(N(R2R1t	closehookthookargs(R3R_R<R=((s/usr/lib/python2.6/urllib.pyR1s	cCsAti||io&|i|id|_d|_ndS(N(R2RFR<R=R%(R3((s/usr/lib/python2.6/urllib.pyRFs


	(R5R6RR1RF(((s/usr/lib/python2.6/urllib.pyR*s	taddinfocBs eZdZdZdZRS(s.class to add an info() method to an open file.cCsti||||_dS(N(R2R1R^(R3R_R^((s/usr/lib/python2.6/urllib.pyR1scCs|iS(N(R^(R3((s/usr/lib/python2.6/urllib.pyRjs(R5R6RR1Rj(((s/usr/lib/python2.6/urllib.pyR>s	RScBs5eZdZddZdZdZdZRS(s9class to add info() and geturl() methods to an open file.cCs/ti||||_||_||_dS(N(R2R1R^R(tcode(R3R_R^R(R?((s/usr/lib/python2.6/urllib.pyR1s		cCs|iS(N(R^(R3((s/usr/lib/python2.6/urllib.pyRjscCs|iS(N(R?(R3((s/usr/lib/python2.6/urllib.pytgetcodescCs|iS(N(R((R3((s/usr/lib/python2.6/urllib.pytgeturlsN(R5R6RR%R1RjR@RA(((s/usr/lib/python2.6/urllib.pyRSs
		cCsdS(Ni((tx((s/usr/lib/python2.6/urllib.pyt_is_unicodescCs
t|tS(N(Rtunicode(RB((s/usr/lib/python2.6/urllib.pyRCscCsXt|oGy|id}WqTtj
o!tdt|dqTXn|S(stoBytes(u"URL") --> 'URL'.tASCIIsURL s contains non-ASCII characters(RCtencodetUnicodeErrortrepr(R(((s/usr/lib/python2.6/urllib.pyRRs
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/lib/python2.6/urllib.pyRs"cCsztdjoddk}|idanti|}|o.|id}|i|t|dfSd|fS(s:splittype('type:opaquestring') --> 'type', 'opaquestring'.iNs
^([^/:]+):i(t	_typeprogR%RtcompileRtgroupRRr(R(RRR((s/usr/lib/python2.6/urllib.pyR
s
cCs]tdjoddk}|idanti|}|o|iddSd|fS(s;splithost('//host[:port]/path') --> 'host[:port]', '/path'.iNs^//([^/?]*)(.*)$ii(t	_hostprogR%RRLRRM(R(RR((s/usr/lib/python2.6/urllib.pyRs
cCsftdjoddk}|idanti|}|ott|iddSd|fS(sJsplituser('user[:passwd]@host[:port]') --> 'user[:passwd]', 'host[:port]'.iNs^(.*)@(.*)$ii(t	_userprogR%RRLRtmapRRM(RcRR((s/usr/lib/python2.6/urllib.pyR's
cCs]tdjoddk}|idanti|}|o|iddS|dfS(s/splitpasswd('user:passwd') -> 'user', 'passwd'.iNs^([^:]*):(.*)$ii(t_passwdprogR%RRLRRM(RRR((s/usr/lib/python2.6/urllib.pyR3s
cCs]tdjoddk}|idanti|}|o|iddS|dfS(s*splitport('host:port') --> 'host', 'port'.iNs^(.*):([0-9]+)$ii(t	_portprogR%RRLRRM(RcRR((s/usr/lib/python2.6/urllib.pyR@s
cCstdjoddk}|idanti|}|oc|idd\}}y$|p
tdnt|}Wntj
o
d}nX||fS||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%RRLRRMRRp(RctdefportRRRtnport((s/usr/lib/python2.6/urllib.pyRLs

cCs]tdjoddk}|idanti|}|o|iddS|dfS(s/splitquery('/path?query') --> '/path', 'query'.iNs^(.*)\?([^?]*)$ii(t
_queryprogR%RRLRRM(R(RR((s/usr/lib/python2.6/urllib.pyRbs
cCs]tdjoddk}|idanti|}|o|iddS|dfS(s)splittag('/path#tag') --> '/path', 'tag'.iNs^(.*)#([^#]*)$ii(t_tagprogR%RRLRRM(R(RR((s/usr/lib/python2.6/urllib.pyR
ns
cCs!|id}|d|dfS(sksplitattr('/path;attr1=value1;attr2=value2;...') ->
        '/path', ['attr1=value1', 'attr2=value2', ...].Rii(R(R(twords((s/usr/lib/python2.6/urllib.pyRyscCs]tdjoddk}|idanti|}|o|iddS|dfS(s-splitvalue('attr=value') --> 'attr', 'value'.iNs^([^=]*)=(.*)$ii(t
_valueprogR%RRLRRM(RRR((s/usr/lib/python2.6/urllib.pyRs
ccs)x"|]}d|t|fVqWdS(s%02xN(tchr(t.0R((s/usr/lib/python2.6/urllib.pys	<genexpr>s	iccs)x"|]}d|t|fVqWdS(s%02XN(RZ(R[R((s/usr/lib/python2.6/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%iiiRh(	RtxrangeRrt	_hextochrtKeyErrortUnicodeDecodeErrortunichrRpR(tstresRtitem((s/usr/lib/python2.6/urllib.pyRs
.cCs|idd}t|S(s%unquote('%7e/abc+def') -> '~/abc def't+t (RUR(Rb((s/usr/lib/python2.6/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%%%02XRh(talways_safet	_safemapsR_trangeRZRPt__getitem__R(RbRtcachekeytsafe_mapRtcRc((s/usr/lib/python2.6/urllib.pyRs

&RhcCs>d|jo$t||d}|iddSt||S(s9Quote the query fragment of a URL; replacing ' ' with '+'RfRe(RRU(RbR((s/usr/lib/python2.6/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 objectRRERUt&(R:RnRrRttuplet	TypeErrorR[R\RRRKRCRFR(
tquerytdoseqttytvattbtlRRRBtelt((s/usr/lib/python2.6/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@tenvironRnR(R#ReR((s/usr/lib/python2.6/urllib.pytgetproxies_environments	cCstiiddptiidd}|djodSt|\}}xC|idD]2}|o%|i|p|i|odSq_WdS(sTest if proxies should not be used for a particular host.

    Checks the environment for a variable named no_proxy, which should
    be a list of DNS suffixes separated by commas, or '*' for all hosts.
    tno_proxyRhtNO_PROXYt*iRi(R@RzR<RRtendswith(RcR|thostonlyRRe((s/usr/lib/python2.6/urllib.pytproxy_bypass_environments+
'	tdarwincCsddkl}l}l}l}|||g|i_||i_|g|i_||i_||g|i	_||i	_|g|i
_||i
_||||g|i_||i_|||g|i_||i_|g|i
_d|i
_dS(Ni(tc_int32tc_void_ptc_char_ptc_int(tctypesRRRRtCFStringCreateWithCStringtargtypestrestypetSCDynamicStoreCopyProxiestCFDictionaryGetValuetCFStringGetLengthtCFStringGetCStringtCFNumberGetValuet	CFReleaseR%(tscRRRR((s/usr/lib/python2.6/urllib.pyt_CFSetup4s"cCsLddkl}|i|d}||}|i|||d|iS(Ni(tcreate_string_bufferii(RRRRR(RRRtlengthtbuff((s/usr/lib/python2.6/urllib.pyt_CStringFromCFStringEs
cCsEddkl}l}|}d}|i|||||iS(Ni(tbyrefRi(RRRRR(RtcfnumRRtvaltkCFNumberSInt32Type((s/usr/lib/python2.6/urllib.pyt_CFNumberToInt32Ls
	c
CsXddkl}ddkl}ddk}ddk}ddkl}d}|i|d}t|d}|pt
S|idd	d}	|idd
d}
|id}|djot
Szid|jo2|i
||
}|ot||otSn|i
||	}
|
o	xt|i|
D]}|i|
|}|pq>nt||}|id|}|dj	o|djo|i|}||}n||id
}t|idd
}d|}||?||?jotSq>|||otSq>Wnt
SWd|i|	|i|
XdS(s
        Return True iff this host shouldn't be accessed using a proxy

        This function uses the MacOSX framework SystemConfiguration
        to fetch the proxy information.
        i(tcdll(tfind_libraryN(tfnmatchcSs{|id}tt|}t|djo|ddddgd }n|dd>|dd>B|dd>B|d	BS(
Nt.iiiiiiii(RRPRpRr(tipAddrtparts((s/usr/lib/python2.6/urllib.pytip2numas
tSystemConfigurationitExceptionsListtExcludeSimpleHostnamesRs(\d+(?:\.\d+)*)(/\d+)?iii (RRtctypes.utilRRRYRtLoadLibraryRR%tFalseRRRRRR]tCFArrayGetCounttCFArrayGetValueAtIndexRRRRMRpR(RcRRRRYRRRthostIPtkSCPropNetProxiesExceptionsListt'kSCPropNetProxiesExcludeSimpleHostnamest	proxyDicttexclude_simplet
exceptionstindexRtmtbasetmask((s/usr/lib/python2.6/urllib.pytproxy_bypass_macosx_sysconfTs\	
	

			


	

cCsddkl}ddkl}|i|d}t||phS|iddd}|iddd}|iddd}|idd	d}|idd
d}|iddd}|iddd}	|idd
d}
|iddd}|iddd}|iddd}
|iddd}|iddd}h}|id}z|i	||}|ot
||o|i	||}|i	||}|oRt||}|o't
||}d||f|d<qd|f|d<qn|i	||}|ot
||o|i	||}|i	||}|oRt||}|o't
||}d||f|d<qd|f|d<qn|i	||	}|ot
||o|i	||}|i	||}|oRt||}|o't
||}d||f|d<qnd|f|d<qrn|i	||
}|ot
||o|i	||}|i	||}|oRt||}|o't
||}d||f|d<qd|f|d<qnWd|i|X|i||i||i||i|	|i|
|i||i||i|
|i||i||S(sReturn a dictionary of scheme -> proxy server URL mappings.

        This function uses the MacOSX framework SystemConfiguration
        to fetch the proxy information.
        i(R(RRit
HTTPEnablet	HTTPProxytHTTPPorttHTTPSEnablet
HTTPSProxyt	HTTPSPortt	FTPEnablet
FTPPassivetFTPPorttFTPProxytGopherEnablet
GopherPorttGopherProxyshttp://%s:%iRs	http://%sRRtgopherN(
RRRRRRRRR%RRRR(RRRtkSCPropNetProxiesHTTPEnabletkSCPropNetProxiesHTTPProxytkSCPropNetProxiesHTTPPorttkSCPropNetProxiesHTTPSEnabletkSCPropNetProxiesHTTPSProxytkSCPropNetProxiesHTTPSPorttkSCPropNetProxiesFTPEnabletkSCPropNetProxiesFTPPassivetkSCPropNetProxiesFTPPorttkSCPropNetProxiesFTPProxytkSCPropNetProxiesGopherEnabletkSCPropNetProxiesGopherPorttkSCPropNetProxiesGopherProxyR#RtenabledRaR((s/usr/lib/python2.6/urllib.pytgetproxies_macosx_sysconfs










cCs#tot|St|SdS(N(R{RR(Rc((s/usr/lib/python2.6/urllib.pyRs
cCstptS(N(R{R(((s/usr/lib/python2.6/urllib.pyRsc	Cskh}yddk}Wntj
o|SXy|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:Rs	http://%ssftp://%sR(
t_winregRtOpenKeytHKEY_CURRENT_USERtQueryValueExRRRRtClosetWindowsErrorRRq(	R#RtinternetSettingstproxyEnabletproxyServertptprotocoltaddressR((s/usr/lib/python2.6/urllib.pytgetproxies_registrys:		

cCstptS(sReturn a dictionary of scheme -> proxy server URL mappings.

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

        (R{R(((s/usr/lib/python2.6/urllib.pyRGsc
CsTyddk}ddk}Wntj
odSXyK|i|id}|i|dd}t|i|dd}Wntj
odSX|p|odSt|\}}|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}
qqWxs|D]k}|idd}|id
d}|idd}x,|D]$}|i|||iod
Sq$WqWdS(Niis;Software\Microsoft\Windows\CurrentVersion\Internet SettingsRt
ProxyOverrideRs<local>Rs	127.0.0.1iRs\.R~s.*t?(RRRRRRRRRRYRRKRZtgetfqdnRRrRRURR(
RcRRRRt
proxyOverridetrawHostRtaddrtfqdnRttestR((s/usr/lib/python2.6/urllib.pytproxy_bypass_registryPsf		
	

	!
cCs#tot|St|SdS(sReturn a dictionary of scheme -> proxy server URL mappings.

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

        N(R{RR(Rc((s/usr/lib/python2.6/urllib.pyRs
cCsd}x$tdD]}|t|}qW|d}ti}t|}t|}ti}||jo	dGHnt|GHt|GHt|GHt||dGdGHdS(NRhiisWrong!itsec(RiRZRRRRHtround(RbRtt0tqstuqstt1((s/usr/lib/python2.6/urllib.pyttest1s


	cCsd|||fGHdS(Ns0Block number: %d, Block size: %d, Total size: %d((R}t	blocksizet	totalsize((s/usr/lib/python2.6/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/RPi
s======RRNs
Rhi(s
----------s
----------(NN(
R:RRKRR%R-RR'Rqtstringt	maketranst	translateR(RLR(tfnRRR_R)ttable((s/usr/lib/python2.6/urllib.pyRs<	

	

c	Csddk}ddk}y#|i|idd\}}Wn#|ij
o}|GHdGHdSXd}xO|D]G\}}|djo|d}n|djodGHd	Gd
GHdSqnW|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(tgetoptR[targvRZRRRRq(	RR[toptsRLRftttoRR(((s/usr/lib/python2.6/urllib.pytmains4#

	
	t__main__(bRRRYR@RR[turlparseRRR$t__all__RRRetmacurl2pathRRt
nturl2patht
rourl2pathR%R&RRRtsslRRRR0R/RDRRRRRRRRRRRR2R*R>RSRDt	NameErrorRCRRRRKRRNRRORRQRRRRRSRRVRRWR
RRYRtdictRiR^tupdateRR	RgRhRRR
R{RtplatformRRRRRRRRRRR-RRR5(((s/usr/lib/python2.6/urllib.pyt<module>s			
	
				N
"				
									
	"@						O	m	
	-			;
		 	


Youez - 2016 - github.com/yon3zu
LinuXploit