Back to index

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

List of all members.

Public Member Functions

def __init__
def run

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 59 of file fcgi.py.


Constructor & Destructor Documentation

def MoinMoin.support.flup.server.fcgi.WSGIServer.__init__ (   self,
  application,
  environ = None,
  multithreaded = True,
  multiprocess = False,
  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.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=multithreaded,
00086                                 multiprocess=multiprocess,
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         ThreadedServer.__init__(self, jobClass=self._connectionClass,
00097                                 jobArgs=(self,), **kw)


Member Function Documentation

Definition at line 98 of file fcgi.py.

00098 
00099     def _isClientAllowed(self, addr):
00100         return self._web_server_addrs is None or \
00101                (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 102 of file fcgi.py.

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


Member Data Documentation

Definition at line 107 of file fcgi.py.


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