author | Sylvain Thénault <sylvain.thenault@logilab.fr> |
Fri, 21 Aug 2009 08:43:28 +0200 | |
branch | 3.5 |
changeset 2945 | f0ab83510477 |
parent 2615 | 1ea41b7c0836 |
child 2790 | 968108e16066 |
child 3539 | f3b14d052798 |
permissions | -rw-r--r-- |
0 | 1 |
"""cubicweb-ctl commands and command handlers common to twisted/modpython |
2 |
web configuration |
|
3 |
||
4 |
:organization: Logilab |
|
1977
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1802
diff
changeset
|
5 |
:copyright: 2001-2009 LOGILAB S.A. (Paris, FRANCE), license is LGPL v2. |
0 | 6 |
:contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr |
1977
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1802
diff
changeset
|
7 |
:license: GNU Lesser General Public License, v2.1 - http://www.gnu.org/licenses |
0 | 8 |
""" |
9 |
__docformat__ = "restructuredtext en" |
|
10 |
||
2395
e3093fc12a00
[cw-ctl] improve dialog messages
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
1977
diff
changeset
|
11 |
from cubicweb import underline_title |
2615
1ea41b7c0836
F [dialog] offer to create backup. refactor to use l.c.shellutils.ASK
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2476
diff
changeset
|
12 |
from cubicweb.toolsutils import CommandHandler |
1ea41b7c0836
F [dialog] offer to create backup. refactor to use l.c.shellutils.ASK
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2476
diff
changeset
|
13 |
from logilab.common.shellutils import ASK |
0 | 14 |
|
15 |
class WebCreateHandler(CommandHandler): |
|
16 |
cmdname = 'create' |
|
1802
d628defebc17
delete-trailing-whitespace + some copyright update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1132
diff
changeset
|
17 |
|
0 | 18 |
def bootstrap(self, cubes, inputlevel=0): |
19 |
"""bootstrap this configuration""" |
|
2395
e3093fc12a00
[cw-ctl] improve dialog messages
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
1977
diff
changeset
|
20 |
print '\n'+underline_title('Generic web configuration') |
0 | 21 |
config = self.config |
22 |
if config.repo_method == 'pyro': |
|
2395
e3093fc12a00
[cw-ctl] improve dialog messages
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
1977
diff
changeset
|
23 |
print '\n'+underline_title('Repository server configuration') |
0 | 24 |
config.input_config('pyro-client', inputlevel) |
2615
1ea41b7c0836
F [dialog] offer to create backup. refactor to use l.c.shellutils.ASK
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2476
diff
changeset
|
25 |
if ASK.confirm('Allow anonymous access ?', False): |
1802
d628defebc17
delete-trailing-whitespace + some copyright update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1132
diff
changeset
|
26 |
config.global_set_option('anonymous-user', 'anon') |
d628defebc17
delete-trailing-whitespace + some copyright update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1132
diff
changeset
|
27 |
config.global_set_option('anonymous-password', 'anon') |
d628defebc17
delete-trailing-whitespace + some copyright update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1132
diff
changeset
|
28 |
|
0 | 29 |
def postcreate(self): |
2476
1294a6bdf3bf
application -> instance where it makes sense
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2395
diff
changeset
|
30 |
"""hooks called once instance's initialization has been completed""" |