cubicweb/etwist/twconfig.py
changeset 12527 bcb895aa2684
parent 12376 890853079ce3
child 12529 7276f1c89ddd
equal deleted inserted replaced
12526:b78e3472a7d6 12527:bcb895aa2684
    36     """web instance (in a twisted web server) client of a RQL server"""
    36     """web instance (in a twisted web server) client of a RQL server"""
    37 
    37 
    38     options = merge_options((
    38     options = merge_options((
    39         # ctl configuration
    39         # ctl configuration
    40         ('port',
    40         ('port',
    41          {'type' : 'int',
    41          {'type': 'int',
    42           'default': None,
    42           'default': None,
    43           'help': 'http server port number (default to 8080)',
    43           'help': 'http server port number (default to 8080)',
    44           'group': 'web', 'level': 0,
    44           'group': 'web', 'level': 0,
    45           }),
    45           }),
    46         ('interface',
    46         ('interface',
    47          {'type' : 'string',
    47          {'type': 'string',
    48           'default': '0.0.0.0',
    48           'default': '0.0.0.0',
    49           'help': 'http server address on which to listen (default to everywhere)',
    49           'help': 'http server address on which to listen (default to everywhere)',
    50           'group': 'web', 'level': 1,
    50           'group': 'web', 'level': 1,
    51           }),
    51           }),
    52         ('max-post-length',
    52         ('max-post-length',
    53          {'type' : 'bytes',
    53          {'type': 'bytes',
    54           'default': '100MB',
    54           'default': '100MB',
    55           'help': 'maximum length of HTTP request. Default to 100 MB.',
    55           'help': 'maximum length of HTTP request. Default to 100 MB.',
    56           'group': 'web', 'level': 1,
    56           'group': 'web', 'level': 1,
    57           }),
    57           }),
    58         ('profile',
    58         ('profile',
    59          {'type' : 'string',
    59          {'type': 'string',
    60           'default': None,
    60           'default': None,
    61           'help': 'profile code and use the specified file to store stats if this option is set',
    61           'help': 'profile code and use the specified file to store stats if this option is set',
    62           'group': 'web', 'level': 3,
    62           'group': 'web', 'level': 3,
    63           }),
    63           }),
    64         ('host',
    64         ('host',
    65          {'type' : 'string',
    65          {'type': 'string',
    66           'default': None,
    66           'default': None,
    67           'help': 'host name if not correctly detectable through gethostname',
    67           'help': 'host name if not correctly detectable through gethostname',
    68           'group': 'main', 'level': 1,
    68           'group': 'main', 'level': 1,
    69           }),
    69           }),
    70         ('pid-file',
    70         ('pid-file',
    71          {'type' : 'string',
    71          {'type': 'string',
    72           'default': Method('default_pid_file'),
    72           'default': Method('default_pid_file'),
    73           'help': 'repository\'s pid file',
    73           'help': 'repository\'s pid file',
    74           'group': 'main', 'level': 2,
    74           'group': 'main', 'level': 2,
    75           }),
    75           }),
    76         ('uid',
    76         ('uid',
    77          {'type' : 'string',
    77          {'type': 'string',
    78           'default': None,
    78           'default': None,
    79           'help': 'unix user, if this option is set, use the specified user to start \
    79           'help': 'unix user, if this option is set, use the specified user to start \
    80 the repository rather than the user running the command',
    80 the repository rather than the user running the command',
    81           'group': 'main', 'level': WebConfiguration.mode == 'system'
    81           'group': 'main', 'level': WebConfiguration.mode == 'system'
    82           }),
    82           }),
    85           'default': 4,
    85           'default': 4,
    86           'help': "size of twisted's reactor threadpool. It should probably be not too \
    86           'help': "size of twisted's reactor threadpool. It should probably be not too \
    87 much greater than connection-poolsize",
    87 much greater than connection-poolsize",
    88           'group': 'web', 'level': 3,
    88           'group': 'web', 'level': 3,
    89           }),
    89           }),
    90         ) + WebConfiguration.options)
    90     ) + WebConfiguration.options)
    91 
    91 
    92     def server_file(self):
    92     def server_file(self):
    93         return join(self.apphome, '%s-%s.py' % (self.appid, self.name))
    93         return join(self.apphome, '%s-%s.py' % (self.appid, self.name))
    94 
    94 
    95     def default_base_url(self):
    95     def default_base_url(self):
   101     """repository and web instance in the same twisted process"""
   101     """repository and web instance in the same twisted process"""
   102     name = 'all-in-one'
   102     name = 'all-in-one'
   103     options = merge_options(WebConfigurationBase.options
   103     options = merge_options(WebConfigurationBase.options
   104                             + ServerConfiguration.options)
   104                             + ServerConfiguration.options)
   105 
   105 
   106     cubicweb_appobject_path = WebConfigurationBase.cubicweb_appobject_path | ServerConfiguration.cubicweb_appobject_path
   106     cubicweb_appobject_path = (
   107     cube_appobject_path = WebConfigurationBase.cube_appobject_path | ServerConfiguration.cube_appobject_path
   107         WebConfigurationBase.cubicweb_appobject_path
       
   108         | ServerConfiguration.cubicweb_appobject_path
       
   109     )
       
   110     cube_appobject_path = (
       
   111         WebConfigurationBase.cube_appobject_path
       
   112         | ServerConfiguration.cube_appobject_path
       
   113     )
   108 
   114 
   109 
   115 
   110 CONFIGURATIONS.append(AllInOneConfiguration)
   116 CONFIGURATIONS.append(AllInOneConfiguration)