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/SimpleHTTPServer.pyo

³ò
h”Rc@södZdZdgZddkZddkZddkZddkZddkZddkZddk	Z	ddk
Z
yddklZWn#e
j
oddklZnXdeifd„ƒYZeeid„ZedjoeƒndS(	s’Simple HTTP Server.

This module builds on BaseHTTPServer by implementing the standard GET
and HEAD requests in a fairly straightforward manner.

s0.6tSimpleHTTPRequestHandleriÿÿÿÿN(tStringIOcBs¯eZdZdeZd„Zd„Zd„Zd„Zd„Z	d„Z
d„Zei
peiƒneiiƒZeihd	d
<dd<dd
<dd<ƒRS(sWSimple HTTP request handler with GET and HEAD commands.

    This serves files from the current directory and any of its
    subdirectories.  The MIME type for files is determined by
    calling the .guess_type() method.

    The GET and HEAD requests are identical except that the HEAD
    request omits the actual contents of the file.

    sSimpleHTTP/cCs8|iƒ}|o!|i||iƒ|iƒndS(sServe a GET request.N(t	send_headtcopyfiletwfiletclose(tselftf((s,/usr/local/lib/python2.5/SimpleHTTPServer.pytdo_GET*scCs%|iƒ}|o|iƒndS(sServe a HEAD request.N(RR(RR((s,/usr/local/lib/python2.5/SimpleHTTPServer.pytdo_HEAD1sc
Cs«|i|iƒ}d}tii|ƒož|iidƒp6|idƒ|id|idƒ|iƒdSnxRdD]9}tii	||ƒ}tii
|ƒo|}Pq{q{W|i|ƒSn|i|ƒ}|i
dƒo
d}nd}yt||ƒ}Wn'tj
o|id	d
ƒdSnX|idƒ|id|ƒti|iƒƒ}|id
t|dƒƒ|id|i|iƒƒ|iƒ|S(s{Common code for GET and HEAD commands.

        This sends the response code and MIME headers.

        Return value is either a file object (which has to be copied
        to the outputfile by the caller unless the command was HEAD,
        and must be closed by the caller under all circumstances), or
        None, in which case the caller has nothing further to do.

        t/i-tLocations
index.htmls	index.htmstext/trtrbi”sFile not foundiÈsContent-typesContent-Lengthis
Last-ModifiedN(s
index.htmls	index.htm(ttranslate_pathtpathtNonetostisdirtendswitht
send_responsetsend_headertend_headerstjointexiststlist_directoryt
guess_typet
startswithtopentIOErrort
send_errortfstattfilenotstrtdate_time_stringtst_mtime(RRRtindextctypetmodetfs((s,/usr/local/lib/python2.5/SimpleHTTPServer.pyR7s>

	
	

c
	Cs²yti|ƒ}Wn*tij
o|iddƒdSnX|idd„ƒtƒ}tit	i
|iƒƒ}|id|ƒ|id|ƒ|idƒx¢|D]š}tii
||ƒ}|}}tii|ƒo|d}|d}ntii|ƒo|d	}n|id
t	i|ƒti|ƒfƒq­W|idƒ|iƒ}	|idƒ|id
ƒ|iddƒ|idt|	ƒƒ|iƒ|S(sûHelper to produce a directory listing (absent index.html).

        Return value is either a file object, or None (indicating an
        error).  In either case, the headers are sent, making the
        interface the same as for send_head().

        i”sNo permission to list directorytkeycSs
|iƒS((tlower(ta((s,/usr/local/lib/python2.5/SimpleHTTPServer.pyt<lambda>qss(<title>Directory listing for %s</title>
s"<h2>Directory listing for %s</h2>
s
<hr>
<ul>
R
t@s<li><a href="%s">%s</a>
s</ul>
<hr>
iiÈsContent-types	text/htmlsContent-LengthN(RtlistdirterrorRRtsortRtcgitescapeturllibtunquoteRtwriteRRtislinktquotettelltseekRRR!R(
RRtlistRtdisplaypathtnametfullnametdisplaynametlinknametlength((s,/usr/local/lib/python2.5/SimpleHTTPServer.pyRds<		


	$



cCsÏti|ƒd}titi|ƒƒ}|idƒ}td|ƒ}ti	ƒ}xs|D]k}ti
i|ƒ\}}ti
i|ƒ\}}|titi
fjoq\nti
i||ƒ}q\W|S(sñTranslate a /-separated PATH to the local filename syntax.

        Components that mean special things to the local file system
        (e.g. drive or directory names) are ignored.  (XXX They should
        probably be diagnosed.)

        iR
N(turlparset	posixpathtnormpathR2R3tsplittfilterRRtgetcwdRt
splitdrivetcurdirtpardirR(RRtwordstwordtdrivethead((s,/usr/local/lib/python2.5/SimpleHTTPServer.pyRŒs	cCsti||ƒdS(sñCopy all data between two file objects.

        The SOURCE argument is a file object open for reading
        (or anything with a read() method) and the DESTINATION
        argument is a file object open for writing (or
        anything with a write() method).

        The only reason for overriding this would be to change
        the block size or perhaps to replace newlines by CRLF
        -- note however that this the default server uses this
        to copy binary data as well.

        N(tshutiltcopyfileobj(Rtsourcet
outputfile((s,/usr/local/lib/python2.5/SimpleHTTPServer.pyR¡scCsnti|ƒ\}}||ijo|i|Sn|iƒ}||ijo|i|Sn|idSdS(s»Guess the type of a file.

        Argument is a PATH (a filename).

        Return value is a string of the form type/subtype,
        usable for a MIME Content-type header.

        The default implementation looks the file's extension
        up in the table self.extensions_map, using application/octet-stream
        as a default; however it would be permissible (if
        slow) to look inside the data to make a better guess.

        tN(RAtsplitexttextensions_mapR)(RRtbasetext((s,/usr/local/lib/python2.5/SimpleHTTPServer.pyR±ssapplication/octet-streamRQs
text/plains.pys.cs.h(t__name__t
__module__t__doc__t__version__tserver_versionRR	RRRRRt	mimetypestinitedtinitt	types_maptcopyRStupdate(((s,/usr/local/lib/python2.5/SimpleHTTPServer.pyRs"
			-	(			

			cCsti||ƒdS(N(tBaseHTTPServerttest(tHandlerClasstServerClass((s,/usr/local/lib/python2.5/SimpleHTTPServer.pyRbÔst__main__(RXRYt__all__RRARaR2R@R0RMR[t	cStringIORtImportErrortBaseHTTPRequestHandlerRt
HTTPServerRbRV(((s,/usr/local/lib/python2.5/SimpleHTTPServer.pys<module>s&	¹


Man Man