etwist/twconfig.py
changeset 10235 684215aca046
parent 9252 01bca75ee8bd
child 10301 729f36a1bcfa
equal deleted inserted replaced
10232:cda1bdc3652e 10235:684215aca046
     1 # copyright 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
     1 # copyright 2003-2014 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
     2 # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
     2 # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
     3 #
     3 #
     4 # This file is part of CubicWeb.
     4 # This file is part of CubicWeb.
     5 #
     5 #
     6 # CubicWeb is free software: you can redistribute it and/or modify it under the
     6 # CubicWeb is free software: you can redistribute it and/or modify it under the
    14 # details.
    14 # details.
    15 #
    15 #
    16 # You should have received a copy of the GNU Lesser General Public License along
    16 # You should have received a copy of the GNU Lesser General Public License along
    17 # with CubicWeb.  If not, see <http://www.gnu.org/licenses/>.
    17 # with CubicWeb.  If not, see <http://www.gnu.org/licenses/>.
    18 """twisted server configurations:
    18 """twisted server configurations:
    19 
       
    20 * the "twisted" configuration to get a web instance running in a standalone
       
    21   twisted web server which talk to a repository server using Pyro
       
    22 
    19 
    23 * the "all-in-one" configuration to get a web instance running in a twisted
    20 * the "all-in-one" configuration to get a web instance running in a twisted
    24   web server integrating a repository server in the same process (only available
    21   web server integrating a repository server in the same process (only available
    25   if the repository part of the software is installed
    22   if the repository part of the software is installed
    26 """
    23 """
    80           'default': None,
    77           'default': None,
    81           'help': 'if this option is set, use the specified user to start \
    78           'help': 'if this option is set, use the specified user to start \
    82 the repository rather than the user running the command',
    79 the repository rather than the user running the command',
    83           'group': 'main', 'level': WebConfiguration.mode == 'system'
    80           'group': 'main', 'level': WebConfiguration.mode == 'system'
    84           }),
    81           }),
    85         ('pyro-server',
       
    86          {'type' : 'yn',
       
    87           # pyro is only a recommends by default, so don't activate it here
       
    88           'default': False,
       
    89           'help': 'run a pyro server',
       
    90           'group': 'main', 'level': 1,
       
    91           }),
       
    92         ('webserver-threadpool-size',
    82         ('webserver-threadpool-size',
    93          {'type': 'int',
    83          {'type': 'int',
    94           'default': 4,
    84           'default': 4,
    95           'help': "size of twisted's reactor threadpool. It should probably be not too \
    85           'help': "size of twisted's reactor threadpool. It should probably be not too \
    96 much greater than connection-poolsize",
    86 much greater than connection-poolsize",
   115         options = merge_options(WebConfigurationBase.options
   105         options = merge_options(WebConfigurationBase.options
   116                                 + ServerConfiguration.options)
   106                                 + ServerConfiguration.options)
   117 
   107 
   118         cubicweb_appobject_path = WebConfigurationBase.cubicweb_appobject_path | ServerConfiguration.cubicweb_appobject_path
   108         cubicweb_appobject_path = WebConfigurationBase.cubicweb_appobject_path | ServerConfiguration.cubicweb_appobject_path
   119         cube_appobject_path = WebConfigurationBase.cube_appobject_path | ServerConfiguration.cube_appobject_path
   109         cube_appobject_path = WebConfigurationBase.cube_appobject_path | ServerConfiguration.cube_appobject_path
   120         def pyro_enabled(self):
       
   121             """tell if pyro is activated for the in memory repository"""
       
   122             return self['pyro-server']
       
   123 
   110 
   124 
   111 
   125     CONFIGURATIONS.append(AllInOneConfiguration)
   112     CONFIGURATIONS.append(AllInOneConfiguration)
   126 
   113 
   127 except ImportError:
   114 except ImportError: