Critics have remarked that those four worthies were truly peerless throughout the ages; yet the present falls short of the pastβthe ancients favored unadorned simplicity, whereas the moderns prefer refined elegance. Styles of substance and ornament rise and fall in succession, shifting with the changing mores of the times; such evolution is simply the natural order of things. The ideal lies in honoring antiquity without clashing with the present, and embracing modernity without succumbing to its flawsβembodying that perfect balance of substance and refinement that defines the true gentleman. There is surely no need to abandon a carved palace in favor of a cave dwelling, or to trade a jade carriage for a primitive cart with solid wooden wheels.
Current path: lib64/python2.7/
β¬οΈ Go up: /lib64
οΏ½
zfc @ sοΏ½ d Z d Z d g Z d d l Z d d l Z d d l Z d d l Z d d l Z d d l Z d d l Z d e j
f d οΏ½ οΏ½ YZ d οΏ½ Z e
a d οΏ½ Z d οΏ½ Z e e j d οΏ½ Z e d
k rοΏ½ e οΏ½ n d S( sοΏ½ CGI-savvy HTTP Server.
This module builds on SimpleHTTPServer by implementing GET and POST
requests to cgi-bin scripts.
If the os.fork() function is not present (e.g. on Windows),
os.popen2() is used as a fallback, with slightly altered semantics; if
that function is not present either (e.g. on Macintosh), only Python
scripts are supported, and they are executed by the current process.
In all cases, the implementation is intentionally naive -- all
requests are executed sychronously.
SECURITY WARNING: DON'T USE THIS CODE UNLESS YOU ARE INSIDE A FIREWALL
-- it may execute arbitrary Python code or external programs.
Note that status code 200 is sent prior to execution of a CGI script, so
scripts cannot send other status codes such as 302 (redirect).
s 0.4t CGIHTTPRequestHandleriοΏ½οΏ½οΏ½οΏ½Nc B sοΏ½ e Z d Z e e d οΏ½ Z e e d οΏ½ Z e e d οΏ½ Z d Z d οΏ½ Z d οΏ½ Z
d οΏ½ Z d d g Z d
οΏ½ Z
d οΏ½ Z d οΏ½ Z RS(
sοΏ½ Complete HTTP server with GET, HEAD and POST commands.
GET and HEAD also support running CGI scripts.
The POST command is *only* implemented for CGI scripts.
t forkt popen2t popen3i c C s- | j οΏ½ r | j οΏ½ n | j d d οΏ½ d S( sR Serve a POST request.
This is only implemented for CGI scripts.
iοΏ½ s Can only POST to CGI scriptsN( t is_cgit run_cgit
send_error( t self( ( s% /usr/lib64/python2.7/CGIHTTPServer.pyt do_POST6 s
c C s* | j οΏ½ r | j οΏ½ St j j | οΏ½ Sd S( s- Version of send_head that support CGI scriptsN( R R t SimpleHTTPServert SimpleHTTPRequestHandlert send_head( R ( ( s% /usr/lib64/python2.7/CGIHTTPServer.pyR B s
c C s` t | j οΏ½ } | j d d οΏ½ } | | | | d } } | | j k r\ | | f | _ t St S( s2 Test whether self.path corresponds to a CGI script.
Returns True and updates the cgi_info attribute to the tuple
(dir, rest) if self.path requires running a CGI script.
Returns False otherwise.
If any exception is raised, the caller should assume that
self.path was rejected as invalid and act accordingly.
The default implementation tests whether the normalized url
path begins with one of the strings in self.cgi_directories
(and the next character is a '/' or the end of the string).
t /i ( t _url_collapse_patht patht findt cgi_directoriest cgi_infot Truet False( R t collapsed_patht dir_sept headt tail( ( s% /usr/lib64/python2.7/CGIHTTPServer.pyR I s s /cgi-bins /htbinc C s
t | οΏ½ S( s1 Test whether argument path is an executable file.( t
executable( R R ( ( s% /usr/lib64/python2.7/CGIHTTPServer.pyt
is_executablea s c C s( t j j | οΏ½ \ } } | j οΏ½ d k S( s. Test whether argument path is a Python script.s .pys .pyw( s .pys .pyw( t osR t splitextt lower( R R R R ( ( s% /usr/lib64/python2.7/CGIHTTPServer.pyt is_pythone s c )
C sοΏ½ | j \ } } | d | } | j d t | οΏ½ d οΏ½ } xv | d k rοΏ½ | | } | | d } | j | οΏ½ } t j j | οΏ½ rοΏ½ | | } } | j d t | οΏ½ d οΏ½ } q<