cwctl.py
changeset 10109 479190f019cc
parent 10106 3117f1736f00
child 10235 684215aca046
equal deleted inserted replaced
10108:129af90b2364 10109:479190f019cc
   522           }),
   522           }),
   523         )
   523         )
   524 
   524 
   525     def start_instance(self, appid):
   525     def start_instance(self, appid):
   526         """start the instance's server"""
   526         """start the instance's server"""
       
   527         try:
       
   528             import twisted  # noqa
       
   529         except ImportError:
       
   530             msg = (
       
   531                 "Twisted is required by the 'start' command\n"
       
   532                 "Either install it, or use one of the alternative commands:\n"
       
   533                 "- '{ctl} wsgi {appid}'\n"
       
   534                 "- '{ctl} pyramid {appid}' (requires the pyramid cube)\n")
       
   535             raise ExecutionError(msg.format(ctl='cubicweb-ctl', appid=appid))
   527         config = cwcfg.config_for(appid, debugmode=self['debug'])
   536         config = cwcfg.config_for(appid, debugmode=self['debug'])
   528         init_cmdline_log_threshold(config, self['loglevel'])
   537         init_cmdline_log_threshold(config, self['loglevel'])
   529         if self['profile']:
   538         if self['profile']:
   530             config.global_set_option('profile', self.config.profile)
   539             config.global_set_option('profile', self.config.profile)
   531         helper = self.config_helper(config, cmdname='start')
   540         helper = self.config_helper(config, cmdname='start')