server/serverctl.py
branchstable
changeset 4718 3dc3ad02d091
parent 4670 48ba6f820fae
child 4719 aaed3f813ef8
equal deleted inserted replaced
4717:535705688f4f 4718:3dc3ad02d091
     5 :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
     5 :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
     6 :license: GNU Lesser General Public License, v2.1 - http://www.gnu.org/licenses
     6 :license: GNU Lesser General Public License, v2.1 - http://www.gnu.org/licenses
     7 """
     7 """
     8 __docformat__ = 'restructuredtext en'
     8 __docformat__ = 'restructuredtext en'
     9 
     9 
       
    10 # *ctl module should limit the number of import to be imported as quickly as
       
    11 # possible (for cubicweb-ctl reactivity, necessary for instance for usable bash
       
    12 # completion). So import locally in command helpers.
    10 import sys
    13 import sys
    11 import os
    14 import os
    12 
    15 
    13 from logilab.common.configuration import Configuration
    16 from logilab.common.configuration import Configuration
    14 from logilab.common.clcommands import register_commands, cmd_run, pop_arg
    17 from logilab.common.clcommands import register_commands, cmd_run, pop_arg
    15 from logilab.common.shellutils import ASK
    18 from logilab.common.shellutils import ASK
    16 
    19 
    17 from cubicweb import AuthenticationError, ExecutionError, ConfigurationError
    20 from cubicweb import AuthenticationError, ExecutionError, ConfigurationError
    18 from cubicweb.toolsutils import Command, CommandHandler, underline_title
    21 from cubicweb.toolsutils import Command, CommandHandler, underline_title
    19 from cubicweb.server import SOURCE_TYPES
    22 from cubicweb.server import SOURCE_TYPES
    20 from cubicweb.server.utils import ask_source_config
       
    21 from cubicweb.server.serverconfig import (USER_OPTIONS, ServerConfiguration,
    23 from cubicweb.server.serverconfig import (USER_OPTIONS, ServerConfiguration,
    22                                           SourceConfiguration)
    24                                           SourceConfiguration)
    23 
    25 
    24 # utility functions ###########################################################
    26 # utility functions ###########################################################
    25 
    27 
   130 
   132 
   131     def bootstrap(self, cubes, inputlevel=0):
   133     def bootstrap(self, cubes, inputlevel=0):
   132         """create an instance by copying files from the given cube and by
   134         """create an instance by copying files from the given cube and by
   133         asking information necessary to build required configuration files
   135         asking information necessary to build required configuration files
   134         """
   136         """
       
   137         from cubicweb.server.utils import ask_source_config
   135         config = self.config
   138         config = self.config
   136         print underline_title('Configuring the repository')
   139         print underline_title('Configuring the repository')
   137         config.input_config('email', inputlevel)
   140         config.input_config('email', inputlevel)
   138         # ask for pyro configuration if pyro is activated and we're not using a
   141         # ask for pyro configuration if pyro is activated and we're not using a
   139         # all-in-one config, in which case this is done by the web side command
   142         # all-in-one config, in which case this is done by the web side command