|
1 # copyright 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved. |
|
2 # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr |
|
3 # |
|
4 # This file is part of CubicWeb. |
|
5 # |
|
6 # CubicWeb is free software: you can redistribute it and/or modify it under the |
|
7 # terms of the GNU Lesser General Public License as published by the Free |
|
8 # Software Foundation, either version 2.1 of the License, or (at your option) |
|
9 # any later version. |
|
10 # |
|
11 # logilab-common is distributed in the hope that it will be useful, but WITHOUT |
|
12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
|
13 # FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more |
|
14 # details. |
|
15 # |
|
16 # You should have received a copy of the GNU Lesser General Public License along |
|
17 # with CubicWeb. If not, see <http://www.gnu.org/licenses/>. |
1 """cubicweb-ctl commands and command handlers common to twisted/modpython |
18 """cubicweb-ctl commands and command handlers common to twisted/modpython |
2 web configuration |
19 web configuration |
3 |
20 |
4 :organization: Logilab |
|
5 :copyright: 2001-2010 LOGILAB S.A. (Paris, FRANCE), license is LGPL v2. |
|
6 :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr |
|
7 :license: GNU Lesser General Public License, v2.1 - http://www.gnu.org/licenses |
|
8 """ |
21 """ |
9 __docformat__ = "restructuredtext en" |
22 __docformat__ = "restructuredtext en" |
10 |
23 |
11 from cubicweb.toolsutils import CommandHandler, underline_title |
24 from cubicweb.toolsutils import CommandHandler, underline_title |
12 from logilab.common.shellutils import ASK |
25 from logilab.common.shellutils import ASK |
16 |
29 |
17 def bootstrap(self, cubes, inputlevel=0): |
30 def bootstrap(self, cubes, inputlevel=0): |
18 """bootstrap this configuration""" |
31 """bootstrap this configuration""" |
19 print '\n' + underline_title('Generic web configuration') |
32 print '\n' + underline_title('Generic web configuration') |
20 config = self.config |
33 config = self.config |
21 if config.repo_method == 'pyro': |
34 if config.repo_method == 'pyro' or config.pyro_enabled(): |
22 print '\n' + underline_title('Pyro configuration') |
35 print '\n' + underline_title('Pyro configuration') |
23 config.input_config('pyro', inputlevel) |
36 config.input_config('pyro', inputlevel) |
24 if ASK.confirm('Allow anonymous access ?', False): |
37 if ASK.confirm('Allow anonymous access ?', False): |
25 config.global_set_option('anonymous-user', 'anon') |
38 config.global_set_option('anonymous-user', 'anon') |
26 config.global_set_option('anonymous-password', 'anon') |
39 config.global_set_option('anonymous-password', 'anon') |