web/webctl.py
author Sylvain Thénault <sylvain.thenault@logilab.fr>
Fri, 19 Feb 2010 10:04:24 +0100
branchstable
changeset 4646 322c3dd96dd5
parent 4252 6c4f109c2b03
child 5415 6bb0c3a53589
permissions -rw-r--r--
[workflow] finish refactoring introduced by 021035b9a7ab for 'go back' transition: * fix SubWorkflowTransition.destination() prototype (must now take an entity as argument) * fix the change state for to give the entity to the transition's destination() method * we need a new method to draw workflow since we've no entity to give and 'go back' transition usually go back to multiple states

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

:organization: Logilab
:copyright: 2001-2010 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, underline_title
from logilab.common.shellutils import ASK

class WebCreateHandler(CommandHandler):
    cmdname = 'create'

    def bootstrap(self, cubes, inputlevel=0):
        """bootstrap this configuration"""
        print '\n' + underline_title('Generic web configuration')
        config = self.config
        if config.repo_method == 'pyro':
            print '\n' + underline_title('Pyro configuration')
            config.input_config('pyro', inputlevel)
        if ASK.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 instance's initialization has been completed"""