web/webctl.py
branchstable
changeset 7140 ba51dac1115d
parent 7132 e9c92bb79787
child 7274 4653a2a5110b
equal deleted inserted replaced
7139:20807d3d7cf6 7140:ba51dac1115d
    26 from cubicweb.toolsutils import CommandHandler, underline_title
    26 from cubicweb.toolsutils import CommandHandler, underline_title
    27 
    27 
    28 class WebCreateHandler(CommandHandler):
    28 class WebCreateHandler(CommandHandler):
    29     cmdname = 'create'
    29     cmdname = 'create'
    30 
    30 
    31     def bootstrap(self, cubes, inputlevel=0):
    31     def bootstrap(self, cubes, automatic=False, inputlevel=0):
    32         """bootstrap this configuration"""
    32         """bootstrap this configuration"""
    33         print '\n' + underline_title('Generic web configuration')
    33         if not automatic:
    34         config = self.config
    34             print '\n' + underline_title('Generic web configuration')
    35         if config.repo_method == 'pyro' or config.pyro_enabled():
    35             config = self.config
    36             print '\n' + underline_title('Pyro configuration')
    36             if config.repo_method == 'pyro' or config.pyro_enabled():
    37             config.input_config('pyro', inputlevel)
    37                 print '\n' + underline_title('Pyro configuration')
    38         if ASK.confirm('Allow anonymous access ?', False):
    38                 config.input_config('pyro', inputlevel)
    39             config.global_set_option('anonymous-user', 'anon')
    39             config.input_config('web', inputlevel)
    40             config.global_set_option('anonymous-password', 'anon')
    40             if ASK.confirm('Allow anonymous access ?', False):
       
    41                 config.global_set_option('anonymous-user', 'anon')
       
    42                 config.global_set_option('anonymous-password', 'anon')
    41 
    43 
    42     def postcreate(self):
    44     def postcreate(self, *args, **kwargs):
    43         """hooks called once instance's initialization has been completed"""
    45         """hooks called once instance's initialization has been completed"""