403Webshell
Server IP : 61.19.30.66  /  Your IP : 216.73.216.15
Web Server : Apache/2.2.22 (Ubuntu)
System : Linux klw 3.11.0-15-generic #25~precise1-Ubuntu SMP Thu Jan 30 17:39:31 UTC 2014 x86_64
User : www-data ( 33)
PHP Version : 5.3.10-1ubuntu3.48
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
MySQL : ON  |  cURL : OFF  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : OFF
Directory :  /usr/lib/python2.7/dist-packages/landscape/lib/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python2.7/dist-packages/landscape/lib/fetch.pyc
ó
}9Rc	@sddlZddlZddlmZddlmZddlmZddlmZde	fd„ƒYZ
de
fd	„ƒYZd
e
fd„ƒYZe
diddd
de
d„Zd„Zd„Zddd„Zdd„Zdd„ZedkreejdƒndS(iÿÿÿÿN(tOptionParser(tStringIO(t
deferToThread(tDeferredListt
FetchErrorcBseZRS((t__name__t
__module__(((s7/usr/lib/python2.7/dist-packages/landscape/lib/fetch.pyRst
HTTPCodeErrorcBs#eZd„Zd„Zd„ZRS(cCs||_||_dS(N(t	http_codetbody(tselfRR	((s7/usr/lib/python2.7/dist-packages/landscape/lib/fetch.pyt__init__s	cCsd|jS(NsServer returned HTTP code %d(R(R
((s7/usr/lib/python2.7/dist-packages/landscape/lib/fetch.pyt__str__scCsd|jS(Ns<HTTPCodeError http_code=%d>(R(R
((s7/usr/lib/python2.7/dist-packages/landscape/lib/fetch.pyt__repr__s(RRRRR
(((s7/usr/lib/python2.7/dist-packages/landscape/lib/fetch.pyRs		tPyCurlErrorcBs2eZd„Zd„Zd„Zed„ƒZRS(cCs||_||_dS(N(t
error_codet_message(R
Rtmessage((s7/usr/lib/python2.7/dist-packages/landscape/lib/fetch.pyRs	cCsd|j|jfS(NsError %d: %s(RR(R
((s7/usr/lib/python2.7/dist-packages/landscape/lib/fetch.pyR"scCsd|j|jfS(Ns<PyCurlError args=(%d, '%s')>(RR(R
((s7/usr/lib/python2.7/dist-packages/landscape/lib/fetch.pyR
%s	cCs|jS(N(R(R
((s7/usr/lib/python2.7/dist-packages/landscape/lib/fetch.pyR)s(RRRRR
tpropertyR(((s7/usr/lib/python2.7/dist-packages/landscape/lib/fetch.pyRs			tiiXc	Csaddl}	t|ƒ}
tƒ}|dkr<|	jƒ}n|r|j|	jtƒ|r|j|	jt|ƒƒ|j|	j	|
j
ƒqn|r»|jdƒr»|j|	j|ƒn|rú|j|	j
gt|jƒƒD]}d|^qàƒn|r|j|	jtƒn|j|	jt|ƒƒ|j|	jtƒ|j|	jdƒ|j|	j|ƒ|j|	jdƒ|j|	j|ƒ|j|	jdƒ|j|	j|jƒ|j|	jdƒ|j|	jdƒy|jƒWn3|	jk
r }
t |
j!d|
j!dƒ‚nX|j"ƒ}|j#|	j$ƒ}|d	kr]t%||ƒ‚n|S(
sTRetrieve a URL and return the content.

    @param url: The url to be fetched.
    @param post: If true, the POST method will be used (defaults to GET).
    @param data: Data to be sent to the server as the POST content.
    @param headers: Dictionary of header => value entries to be used
                    on the request.
    @param cainfo: Path to the file with CA certificates.
    @param insecure: If true, perform curl using insecure option which will
                     not attempt to verify authenticity of the peer's
                     certificate. (Used during autodiscovery)
    iÿÿÿÿNshttps:s%s: %siiisgzip,deflateiÈ(&tpycurlRtNonetCurltsetopttPOSTtTruet
POSTFIELDSIZEtlentREADFUNCTIONtreadt
startswithtCAINFOt
HTTPHEADERtsortedt	iteritemstSSL_VERIFYPEERtFalsetURLtstrtFOLLOWLOCATIONt	MAXREDIRStCONNECTTIMEOUTtLOW_SPEED_LIMITtLOW_SPEED_TIMEtNOSIGNALt
WRITEFUNCTIONtwritetDNS_CACHE_TIMEOUTtENCODINGtperformterrorRtargstgetvaluetgetinfot	HTTP_CODER(turltposttdatatheaderstcainfotcurltconnect_timeoutt
total_timeouttinsecureRtoutputtinputtpairteR	R((s7/usr/lib/python2.7/dist-packages/landscape/lib/fetch.pytfetch.sH	-!cCs~tƒ}|jdddƒ|jdddƒ|jdƒ|j|ƒ\}\}t|d|jd	|jd
|jƒGHdS(Ns--posttactiont
store_trues--datatdefaultRs--cainfoR8R9R;(Rt
add_optiont
parse_argsRDR8R9R;(R3tparsertoptionsR7((s7/usr/lib/python2.7/dist-packages/landscape/lib/fetch.pyttestms	
cOstt||ŽS(s]Retrieve a URL asynchronously.

    @return: A C{Deferred} resulting in the URL content.
    (RRD(R3tkwargs((s7/usr/lib/python2.7/dist-packages/landscape/lib/fetch.pytfetch_asyncwscKs{g}x\|D]T}t||}|r;|j||ƒn|rT|j||ƒn|j|ƒq
Wt|dtdtƒS(s9
    Retrieve a list of URLs asynchronously.

    @param callback: Optionally, a function that will be fired one time for
        each successful URL, and will be passed its content and the URL itself.
    @param errback: Optionally, a function that will be fired one time for each
        failing URL, and will be passed the failure and the URL itself.
    @return: A C{DeferredList} whose callback chain will be fired as soon as
        all downloads have terminated. If an error occurs, the errback chain
        of the C{DeferredList} will be fired immediatly.
    tfireOnOneErrbackt
consumeErrors(RNtaddCallbackt
addErrbacktappendRR(turlstcallbackterrbackRMtresultsR7tresult((s7/usr/lib/python2.7/dist-packages/landscape/lib/fetch.pytfetch_many_asyncs
cCsD|jdƒjdƒd}|dk	r@tjj||ƒ}n|S(sðReturn the last component of the given C{url}.

    @param url: The URL to get the filename from.
    @param directory: Optionally a path to prepend to the returned filename.

    @note: Any trailing slash in the C{url} will be removed
    t/iÿÿÿÿN(trstriptsplitRtostpathtjoin(R7t	directorytfilename((s7/usr/lib/python2.7/dist-packages/landscape/lib/fetch.pyturl_to_filename–scs7‡fd†}‡fd†}t|d|d||S(sJ
    Retrieve a list of URLs and save their content as files in a directory.

    @param urls: The list URLs to fetch.
    @param directory: The directory to save the files to, the name of the file
        will equal the last fragment of the URL.
    @param logger: Optional function to be used to log errors for failed URLs.
    cs<t|dˆƒ}t|dƒ}|j|ƒ|jƒdS(NR`tw(RbtopenR.tclose(R9R7Ratfd(R`(s7/usr/lib/python2.7/dist-packages/landscape/lib/fetch.pyR.®s
cs*ˆr&ˆd|t|jƒfƒn|S(Ns Couldn't fetch file from %s (%s)(R&tvalue(tfailureR7(tlogger(s7/usr/lib/python2.7/dist-packages/landscape/lib/fetch.pyt	log_error´sRURV(RY(RTR`RiRMR.Rj((R`Ris7/usr/lib/python2.7/dist-packages/landscape/lib/fetch.pytfetch_to_files¤s
t__main__i(R]tsystoptparseRRttwisted.internet.threadsRttwisted.internet.deferRt	ExceptionRRRR$RRDRLRNRYRbRkRtargv(((s7/usr/lib/python2.7/dist-packages/landscape/lib/fetch.pyt<module>s"
>	
	

Youez - 2016 - github.com/yon3zu
LinuXploit