config root man

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

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/wsgiref/handlers.pyc

³ò
h”Rc@sydZddklZddklZlZlZddklZddk	Z	ddk
Z
ddkZdddd	gZye
Wnej
od
„Z
nXyeeWn!ej
oeZeZnXddd
ddddgZeddddddddddddg
Zd„Zdfd„ƒYZdefd „ƒYZdefd!„ƒYZd	efd"„ƒYZdS(#s/Base classes for server/gateway implementationsiÿÿÿÿ(t
StringType(tFileWrappertguess_schemet
is_hop_by_hop(tHeadersNtBaseHandlert
SimpleHandlertBaseCGIHandlert
CGIHandlercCs+h}x|D]\}}|||<q
W|S(N((titemstdtktv((s,/usr/local/lib/python2.5/wsgiref/handlers.pytdicts
tMontTuetWedtThutFritSattSuntJantFebtMartAprtMaytJuntJultAugtSeptOcttNovtDecc
	CsOti|ƒ\	}}}}}}}}}	dt||t|||||fS(Ns#%s, %02d %3s %4d %02d:%02d:%02d GMT(ttimetgmtimet_weekdaynamet
_monthname(
t	timestamptyeartmonthtdaythhtmmtsstwdtytz((s,/usr/local/lib/python2.5/wsgiref/handlers.pytformat_date_time"s*cBsbeZdZdZeZeZeZeZ	dZ
d Ze
eiiƒƒZeZeZd ZdZd!gZdZd ZZeZd ZdZd„Zd	„Z d
„Z!d„Z"d„Z#d
„Z$d d„Z%d„Z&d„Z'd„Z(d„Z)d„Z*d„Z+d„Z,d„Z-d„Z.d„Z/d„Z0d„Z1d„Z2d„Z3d„Z4d„Z5RS("s+Manage the invocation of a WSGI applicationiis1.0s500 Dude, this is whack!sContent-Types
text/plains;A server error occurred.  Please contact the administrator.cCscy0|iƒ||i|iƒ|_|iƒWn,y|iƒWq_|iƒ‚q_XnXdS(sInvoke the applicationN(t
setup_environtenvirontstart_responsetresulttfinish_responsethandle_errortclose(tselftapplication((s,/usr/local/lib/python2.5/wsgiref/handlers.pytrunSs

cCsÔ|iiƒ}|_|iƒ|iƒ|d<|iƒ|d<|i|d<|i|d<|iƒ|d<|i	|d<|i
|d<|id
j	o|i|d<n|i
o!|io|id	|iƒnd
S(s&Set up the environment for one requests
wsgi.inputswsgi.errorsswsgi.versions
wsgi.run_onceswsgi.url_schemeswsgi.multithreadswsgi.multiprocessswsgi.file_wrappertSERVER_SOFTWAREN(t
os_environtcopyR1tadd_cgi_varst	get_stdint
get_stderrtwsgi_versiont
wsgi_run_oncet
get_schemetwsgi_multithreadtwsgi_multiprocesstwsgi_file_wrappertNonet
origin_servertserver_softwaret
setdefault(R7tenv((s,/usr/local/lib/python2.5/wsgiref/handlers.pyR0gs




cCsY|iƒp|iƒo/x|iD]}|i|ƒq&W|iƒn|iƒdS(s>Send any iterable data, then close self and the iterable

        Subclasses intended for use in asynchronous servers will
        want to redefine this method, such that it sets up callbacks
        in the event loop to iterate over the data, and to call
        'self.close()' once the response is finished.
        N(tresult_is_filetsendfileR3twritetfinish_contentR6(R7tdata((s,/usr/local/lib/python2.5/wsgiref/handlers.pyR4|s
cCs
t|iƒS(s Return the URL scheme being used(RR1(R7((s,/usr/local/lib/python2.5/wsgiref/handlers.pyRB‹scCsayt|iƒ}Wntttfj
on-X|djot|iƒ|id<dSndS(s@Compute Content-Length or switch to chunked encoding if possibleisContent-LengthN(tlenR3t	TypeErrortAttributeErrortNotImplementedErrortstrt
bytes_senttheaders(R7tblocks((s,/usr/local/lib/python2.5/wsgiref/handlers.pytset_content_lengths
cCs%|iidƒp|iƒndS(sqMake any necessary header changes or defaults

        Subclasses can extend this to add other defaults.
        sContent-LengthN(RVthas_keyRX(R7((s,/usr/local/lib/python2.5/wsgiref/handlers.pytcleanup_headersscCsZ|o8z*|io|d|d|d‚nWdd}Xn!|idj	otdƒ‚nt|ƒtjp
td‚t|ƒdjp
td‚t|d	 ƒp
td
‚|d	djp
td‚xf|D]^\}}t|ƒtjp
td
‚t|ƒtjp
td‚t|ƒp
td‚qÖW||_	|i
|ƒ|_|iS(s3'start_response()' callable as specified by PEP 333iiiNsHeaders already set!sStatus must be a stringis$Status must be at least 4 charactersis(Status message must begin w/3-digit codet s+Status message must have a space after codesHeader names must be stringssHeader values must be stringssHop-by-hop headers not allowed(theaders_sentRFRVtAssertionErrorttypeRRPtintRtstatust
headers_classRM(R7R`RVtexc_infotnametval((s,/usr/local/lib/python2.5/wsgiref/handlers.pyR2¥s&
 	cCs¾|ioœ|iƒo‹|id|i|ifƒ|iidƒp!|idttiƒƒƒn|i	o,|iidƒo|id|i	ƒq¢qºn|id|iƒdS(s6Transmit version/status/date/server, via self._write()sHTTP/%s %s
tDates
Date: %s
tServersServer: %s
sStatus: %s
N(
RGtclient_is_modernt_writethttp_versionR`RVRYR/R!RH(R7((s,/usr/local/lib/python2.5/wsgiref/handlers.pyt
send_preambleÀs

 cCsŽt|ƒtjp
td‚|iptdƒ‚n=|ipt|ƒ|_|iƒn|it|ƒ7_|i|ƒ|i	ƒdS(s*'write()' callable as specified by PEP 333swrite() argument must be stringswrite() before start_response()N(
R^RR]R`R\RPRUtsend_headersRht_flush(R7RO((s,/usr/local/lib/python2.5/wsgiref/handlers.pyRMÎs


cCstS(sPlatform-specific file transmission

        Override this method in subclasses to support platform-specific
        file transmission.  It is only called if the application's
        return iterable ('self.result') is an instance of
        'self.wsgi_file_wrapper'.

        This method should return a true value if it was able to actually
        transmit the wrapped file-like object using a platform-specific
        approach.  It should return a false value if normal iteration
        should be used instead.  An exception can be raised to indicate
        that transmission was attempted, but failed.

        NOTE: this method should call 'self.send_headers()' if
        'self.headers_sent' is false and it is going to attempt direct
        transmission of the file.
        (tFalse(R7((s,/usr/local/lib/python2.5/wsgiref/handlers.pyRLâscCs)|ipd|id<|iƒndS(s.Ensure headers and content have both been sentt0sContent-LengthN(R\RVRk(R7((s,/usr/local/lib/python2.5/wsgiref/handlers.pyRN÷s

cCs`z(t|idƒo|iiƒnWdd|_|_|_|_d|_t|_	XdS(s„Close the iterable (if needed) and reset all instance vars

        Subclasses may want to also drop the client connection.
        R6Ni(
thasattrR3R6RFRVR`R1RURmR\(R7((s,/usr/local/lib/python2.5/wsgiref/handlers.pyR6ÿs	cCsS|iƒt|_|ip
|iƒo$|iƒ|it|iƒƒndS(s1Transmit headers to the client, via self._write()N(	RZtTrueR\RGRgRjRhRTRV(R7((s,/usr/local/lib/python2.5/wsgiref/handlers.pyRks

	
cCs&|i}|dj	ot|i|ƒS(s@True if 'self.result' is an instance of 'self.wsgi_file_wrapper'N(RERFt
isinstanceR3(R7twrapper((s,/usr/local/lib/python2.5/wsgiref/handlers.pyRKs	cCs|idiƒdjS(s,True if client can accept status and headerstSERVER_PROTOCOLsHTTP/0.9(R1tupper(R7((s,/usr/local/lib/python2.5/wsgiref/handlers.pyRgsc
Cs]zOddkl}|iƒ}||d|d|d|i|ƒ|iƒWdd}XdS(sLog the 'exc_info' tuple in the server log

        Subclasses may override to retarget the output or change its format.
        iÿÿÿÿ(tprint_exceptioniiiN(t	tracebackRuR?ttraceback_limittflushRF(R7RbRutstderr((s,/usr/local/lib/python2.5/wsgiref/handlers.pyt
log_exception s
cCsJ|itiƒƒ|ip)|i|i|iƒ|_|iƒndS(s>Log current error, and send error output to client if possibleN(	RztsysRbR\terror_outputR1R2R3R4(R7((s,/usr/local/lib/python2.5/wsgiref/handlers.pyR50s
cCs'||i|itiƒƒ|igS(sZWSGI mini-app to create error output

        By default, this just uses the 'error_status', 'error_headers',
        and 'error_body' attributes to generate an output page.  It can
        be overridden in a subclass to dynamically generate diagnostics,
        choose an appropriate message for the user's preferred language, etc.

        Note, however, that it's not recommended from a security perspective to
        spit out diagnostics to any old user; ideally, you should have to do
        something special to enable diagnostic output, which is why we don't
        include any here!
        (terror_statust
error_headersR{Rbt
error_body(R7R1R2((s,/usr/local/lib/python2.5/wsgiref/handlers.pyR|8s
cCs
t‚dS(sOverride in subclass to buffer data for send to client

        It's okay if this method actually transmits the data; BaseHandler
        just separates write and flush operations for greater efficiency
        when the underlying system actually has such a distinction.
        N(RS(R7RO((s,/usr/local/lib/python2.5/wsgiref/handlers.pyRhKscCs
t‚dS(s¬Override in subclass to force sending of recent '_write()' calls

        It's okay if this method is a no-op (i.e., if '_write()' actually
        sends the data.
        N(RS(R7((s,/usr/local/lib/python2.5/wsgiref/handlers.pyRlTscCs
t‚dS(s4Override in subclass to return suitable 'wsgi.input'N(RS(R7((s,/usr/local/lib/python2.5/wsgiref/handlers.pyR>\scCs
t‚dS(s5Override in subclass to return suitable 'wsgi.errors'N(RS(R7((s,/usr/local/lib/python2.5/wsgiref/handlers.pyR?`scCs
t‚dS(s>Override in subclass to insert CGI variables in 'self.environ'N(RS(R7((s,/usr/local/lib/python2.5/wsgiref/handlers.pyR=ds(iiN(sContent-Types
text/plain(6t__name__t
__module__t__doc__R@RpRCRDRmRARGRiRFRHR
tosR1R	R;RRERRaRwR}R~RR`R3R\RVRUR9R0R4RBRXRZR2RjRMRLRNR6RkRKRgRzR5R|RhRlR>R?R=(((s,/usr/local/lib/python2.5/wsgiref/handlers.pyR*sT	
						
						
												cBsJeZdZeed„Zd„Zd„Zd„Zd„Z	d„Z
RS(sqHandler that's just initialized with streams, environment, etc.

    This handler subclass is intended for synchronous HTTP/1.0 origin servers,
    and handles sending the entire response output, given the correct inputs.

    Usage::

        handler = SimpleHandler(
            inp,out,err,env, multithread=False, multiprocess=True
        )
        handler.run(app)cCs:||_||_||_||_||_||_dS(N(tstdintstdoutRytbase_envRCRD(R7R„R…RyR1tmultithreadtmultiprocess((s,/usr/local/lib/python2.5/wsgiref/handlers.pyt__init__s					cCs|iS(N(R„(R7((s,/usr/local/lib/python2.5/wsgiref/handlers.pyR>‰scCs|iS(N(Ry(R7((s,/usr/local/lib/python2.5/wsgiref/handlers.pyR?ŒscCs|ii|iƒdS(N(R1tupdateR†(R7((s,/usr/local/lib/python2.5/wsgiref/handlers.pyR=scCs#|ii|ƒ|ii|_dS(N(R…RMRh(R7RO((s,/usr/local/lib/python2.5/wsgiref/handlers.pyRh’scCs |iiƒ|ii|_dS(N(R…RxRl(R7((s,/usr/local/lib/python2.5/wsgiref/handlers.pyRl–s
(R€RR‚RpRmR‰R>R?R=RhRl(((s,/usr/local/lib/python2.5/wsgiref/handlers.pyRrs					cBseZdZeZRS(sÚCGI-like systems using input/output/error streams and environ mapping

    Usage::

        handler = BaseCGIHandler(inp,out,err,env)
        handler.run(app)

    This handler class is useful for gateway protocols like ReadyExec and
    FastCGI, that have usable input/output/error streams and an environment
    mapping.  It's also the base class for CGIHandler, which just uses
    sys.stdin, os.environ, and so on.

    The constructor also takes keyword arguments 'multithread' and
    'multiprocess' (defaulting to 'True' and 'False' respectively) to control
    the configuration sent to the application.  It sets 'origin_server' to
    False (to enable CGI-like output), and assumes that 'wsgi.run_once' is
    False.
    (R€RR‚RmRG(((s,/usr/local/lib/python2.5/wsgiref/handlers.pyR›scBseZdZeZd„ZRS(séCGI-based invocation via sys.stdin/stdout/stderr and os.environ

    Usage::

        CGIHandler().run(app)

    The difference between this class and BaseCGIHandler is that it always
    uses 'wsgi.run_once' of 'True', 'wsgi.multithread' of 'False', and
    'wsgi.multiprocess' of 'True'.  It does not take any initialization
    parameters, but always uses 'sys.stdin', 'os.environ', and friends.

    If you need to override any of these parameters, use BaseCGIHandler
    instead.
    c
CsAti|tititittii	ƒƒdt
dtƒdS(NR‡Rˆ(RR‰R{R„R…RyR
RƒR1R	RmRp(R7((s,/usr/local/lib/python2.5/wsgiref/handlers.pyR‰×s*(R€RR‚RpRAR‰(((s,/usr/local/lib/python2.5/wsgiref/handlers.pyRÄs(R‚ttypesRtutilRRRRVRR{RƒR!t__all__R
t	NameErrorRpRmRFR#R$R/RRRR(((s,/usr/local/lib/python2.5/wsgiref/handlers.pys<module>s2$	ÿI))

Man Man