web/webctl.py
author Aurelien Campeas <aurelien.campeas@logilab.fr>
Wed, 08 Jul 2009 17:50:42 +0200
branchstable
changeset 2329 8b5a1af6dc35
parent 1977 606923dff11b
child 2395 e3093fc12a00
permissions -rw-r--r--
[reledit] small cleanup and add escape param to control xml_escapability of the value, also rename vid arg which clashes with entity.view(...) args

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

:organization: Logilab
:copyright: 2001-2009 LOGILAB S.A. (Paris, FRANCE), license is LGPL v2.
:contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
:license: GNU Lesser General Public License, v2.1 - http://www.gnu.org/licenses
"""
__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"""