Back to index

moin  1.9.0~rc2
Public Member Functions | Public Attributes | Static Public Attributes
MoinMoin.web.flup_frontend.CGIFrontEnd Class Reference
Inheritance diagram for MoinMoin.web.flup_frontend.CGIFrontEnd:
Inheritance graph
[legend]
Collaboration diagram for MoinMoin.web.flup_frontend.CGIFrontEnd:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def run_server
def add_options
def run
def add_options
def run

Public Attributes

 parser
 debug
 parser

Static Public Attributes

dictionary server_types

Detailed Description

Simple WSGI CGI Adapter for fallback if flup is not installed. 

Definition at line 134 of file flup_frontend.py.


Constructor & Destructor Documentation

Reimplemented from MoinMoin.web.frontend.FrontEnd.

Definition at line 150 of file flup_frontend.py.

00150 
00151         def __init__(self):
00152             logging.warning("No flup-package installed, only basic CGI "
00153                             "support is available.")
00154             super(CGIFrontEnd, self).__init__()


Member Function Documentation

def MoinMoin.web.frontend.FrontEnd.add_options (   self) [inherited]

Reimplemented in MoinMoin.web.frontend.ServerFrontEnd, and MoinMoin.web.flup_frontend.FlupFrontEnd.

Definition at line 20 of file frontend.py.

00020 
00021     def add_options(self):
00022         parser = self.parser
00023         parser.add_option("-d", "--debug", dest="debug",
00024                           help="Debug mode of server (off/web/external, default is to use MOIN_DEBUGGER env var)")
00025         parser.add_option("-c", "--config-dir", dest="config_dir", metavar="DIR",
00026                           help=("Path to the directory containing the wiki "
00027                                 "configuration files. Default: current directory"))
00028         parser.add_option("--htdocs", dest="htdocs",
00029                           help=("Path to the directory containing Moin's "
00030                                 "static files. Default: use builtin MoinMoin/web/static/htdocs"))
00031         parser.set_default('htdocs', True)

Reimplemented from MoinMoin.web.frontend.ServerFrontEnd.

Definition at line 47 of file flup_frontend.py.

00047 
00048         def add_options(self):
00049             super(FlupFrontEnd, self).add_options()
00050             parser = self.parser
00051             parser.add_option("--min-spare", dest="min_spare", type="int", metavar='MIN',
00052                               help=("Minimum spare threads/processes (when "
00053                                     "using threaded or forking servers)."))
00054             parser.add_option("--max-spare", dest="max_spare", type="int", metavar='MAX',
00055                               help=("Maximum spare threads/processes (when "
00056                                     "using threaded or forking servers)."))
00057             parser.add_option("--max-childs", dest="max_childs", type="int", metavar='CHILDS',
00058                               help=("Hard upper limit on threads/processes "
00059                                     "(when using threaded or forking servers)."))
00060             parser.add_option("-t", "--type", dest="server_type", metavar='TYPE',
00061                               help=("Type of server to use, e.g. single/threaded"
00062                                     "/forking. Defaults to 'single' when not "
00063                                     "bound to a socket and to 'threaded' when it is"))

def MoinMoin.web.frontend.FrontEnd.run (   self,
  args = None 
) [inherited]

Definition at line 32 of file frontend.py.

00032 
00033     def run(self, args=None):
00034         options, args = self.parser.parse_args(args)
00035         logging.debug('Options: %r', options)
00036 
00037         application = make_application(shared=options.htdocs)
00038 
00039         try:
00040             self.run_server(application, options)
00041         except SystemExit, err:
00042             # the flup CGIRequest uses sys.exit(0) to terminate
00043             if err.code: # log a non-zero exit status (0 means no error)
00044                 logging.exception('A SystemExit(%d) exception occurred.' % err.code)
00045             raise # exit now with this exit status
00046         except:
00047             logging.exception('An exception occurred while running %s' % self.__class__.__name__)

Here is the call graph for this function:

Here is the caller graph for this function:

def MoinMoin.web.frontend.FrontEnd.run (   self,
  args = None 
) [inherited]

Definition at line 32 of file frontend.py.

00032 
00033     def run(self, args=None):
00034         options, args = self.parser.parse_args(args)
00035         logging.debug('Options: %r', options)
00036 
00037         application = make_application(shared=options.htdocs)
00038 
00039         try:
00040             self.run_server(application, options)
00041         except SystemExit, err:
00042             # the flup CGIRequest uses sys.exit(0) to terminate
00043             if err.code: # log a non-zero exit status (0 means no error)
00044                 logging.exception('A SystemExit(%d) exception occurred.' % err.code)
00045             raise # exit now with this exit status
00046         except:
00047             logging.exception('An exception occurred while running %s' % self.__class__.__name__)

Here is the call graph for this function:

Here is the caller graph for this function:

def MoinMoin.web.flup_frontend.CGIFrontEnd.run_server (   self,
  application,
  options 
)

Reimplemented from MoinMoin.web.flup_frontend.FlupFrontEnd.

Definition at line 155 of file flup_frontend.py.

00155 
00156         def run_server(self, application, options):
00157             from MoinMoin.web._fallback_cgi import WSGIServer
00158             return WSGIServer(application).run()
00159 
    _ERROR = """

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 94 of file flup_frontend.py.

Definition at line 17 of file frontend.py.

Definition at line 17 of file frontend.py.

Initial value:
{'threaded': 'flup.server.fcgi',
                        'forking': 'flup.server.fcgi_fork'}

Definition at line 135 of file flup_frontend.py.


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