web/webctl.py
author sylvain.thenault@logilab.fr
Fri, 27 Mar 2009 12:23:00 +0100
branchtls-sprint
changeset 1175 96747df28a1f
parent 1132 96752791c2b6
child 1802 d628defebc17
permissions -rw-r--r--
backport subject_in_state_vocabulary to EntityFieldsForm, deprecate the old one

"""cubicweb-ctl commands and command handlers common to twisted/modpython
web configuration

:organization: Logilab
:copyright: 2001-2009 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
:contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
"""
__docformat__ = "restructuredtext en"

from cubicweb.toolsutils import CommandHandler, confirm


class WebCreateHandler(CommandHandler):
    cmdname = 'create'
    
    def bootstrap(self, cubes, inputlevel=0):
        """bootstrap this configuration"""
        print '** generic web configuration'
        config = self.config
        if config.repo_method == 'pyro':
            print
            print '** repository server configuration'
            print '-' * 72
            config.input_config('pyro-client', inputlevel)
        if confirm('allow anonymous access', False):
            config.global_set_option('anonymous-user', 'anon') 
            config.global_set_option('anonymous-password', 'anon') 
        
    def postcreate(self):
        """hooks called once application's initialization has been completed"""