Back to index

moin  1.9.0~rc2
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes
MoinMoin.support.flup.server.fcgi_single.WSGIServer Class Reference
Inheritance diagram for MoinMoin.support.flup.server.fcgi_single.WSGIServer:
Inheritance graph
[legend]
Collaboration diagram for MoinMoin.support.flup.server.fcgi_single.WSGIServer:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def run

Public Attributes

 capability

Private Member Functions

def _isClientAllowed

Private Attributes

 _web_server_addrs

Detailed Description

FastCGI server that supports the Web Server Gateway Interface. See
<http://www.python.org/peps/pep-0333.html>.

Definition at line 60 of file fcgi_single.py.


Constructor & Destructor Documentation

def MoinMoin.support.flup.server.fcgi_single.WSGIServer.__init__ (   self,
  application,
  environ = None,
  bindAddress = None,
  umask = None,
  multiplexed = False,
  debug = False,
  roles = (FCGI_RESPONDER,,
  forceCGI = False,
  kw 
)
environ, if present, must be a dictionary-like object. Its
contents will be copied into application's environ. Useful
for passing application-specific variables.

bindAddress, if present, must either be a string or a 2-tuple. If
present, run() will open its own listening socket. You would use
this if you wanted to run your application as an 'external' FastCGI
app. (i.e. the webserver would no longer be responsible for starting
your app) If a string, it will be interpreted as a filename and a UNIX
socket will be opened. If a tuple, the first element, a string,
is the interface name/IP to bind to, and the second element (an int)
is the port number.

Definition at line 67 of file fcgi_single.py.

00067 
00068                  debug=False, roles=(FCGI_RESPONDER,), forceCGI=False, **kw):
00069         """
00070         environ, if present, must be a dictionary-like object. Its
00071         contents will be copied into application's environ. Useful
00072         for passing application-specific variables.
00073 
00074         bindAddress, if present, must either be a string or a 2-tuple. If
00075         present, run() will open its own listening socket. You would use
00076         this if you wanted to run your application as an 'external' FastCGI
00077         app. (i.e. the webserver would no longer be responsible for starting
00078         your app) If a string, it will be interpreted as a filename and a UNIX
00079         socket will be opened. If a tuple, the first element, a string,
00080         is the interface name/IP to bind to, and the second element (an int)
00081         is the port number.
00082         """
00083         BaseFCGIServer.__init__(self, application,
00084                                 environ=environ,
00085                                 multithreaded=False,
00086                                 multiprocess=False,
00087                                 bindAddress=bindAddress,
00088                                 umask=umask,
00089                                 multiplexed=multiplexed,
00090                                 debug=debug,
00091                                 roles=roles,
00092                                 forceCGI=forceCGI)
00093         for key in ('jobClass', 'jobArgs'):
00094             if kw.has_key(key):
00095                 del kw[key]
00096         SingleServer.__init__(self, jobClass=self._connectionClass,
00097                               jobArgs=(self,), **kw)
00098         self.capability = {
00099             FCGI_MAX_CONNS: 1,
00100             FCGI_MAX_REQS: 1,
00101             FCGI_MPXS_CONNS: 0
00102             }


Member Function Documentation

Definition at line 103 of file fcgi_single.py.

00103 
00104     def _isClientAllowed(self, addr):
00105         return self._web_server_addrs is None or \
00106                (len(addr) == 2 and addr[0] in self._web_server_addrs)

Here is the caller graph for this function:

The main loop. Exits on SIGHUP, SIGINT, SIGTERM. Returns True if
SIGHUP was received, False otherwise.

Definition at line 107 of file fcgi_single.py.

00107 
00108     def run(self):
00109         """
00110         The main loop. Exits on SIGHUP, SIGINT, SIGTERM. Returns True if
00111         SIGHUP was received, False otherwise.
00112         """
00113         self._web_server_addrs = os.environ.get('FCGI_WEB_SERVER_ADDRS')
00114         if self._web_server_addrs is not None:
00115             self._web_server_addrs = map(lambda x: x.strip(),
00116                                          self._web_server_addrs.split(','))
00117 
00118         sock = self._setupSocket()
00119 
00120         ret = SingleServer.run(self, sock)
00121 
00122         self._cleanupSocket(sock)
00123 
00124         return ret


Member Data Documentation

Definition at line 112 of file fcgi_single.py.

Definition at line 97 of file fcgi_single.py.


The documentation for this class was generated from the following file: