author | Aurelien Campeas <aurelien.campeas@logilab.fr> |
Wed, 21 Oct 2009 19:32:53 +0200 | |
branch | stable |
changeset 3780 | 4ff37d54aae1 |
parent 3539 | f3b14d052798 |
child 3589 | a5432f99f2d9 |
child 4212 | ab6573088b4a |
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""" |
|
3539
f3b14d052798
[pyro] merge pyro-id / pyro-instance-id options, put all pyro options in the same section of the configuration file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2615
diff
changeset
|
20 |
print '\n' + underline_title('Generic web configuration') |
0 | 21 |
config = self.config |
22 |
if config.repo_method == 'pyro': |
|
3539
f3b14d052798
[pyro] merge pyro-id / pyro-instance-id options, put all pyro options in the same section of the configuration file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2615
diff
changeset
|
23 |
print '\n' + underline_title('Pyro configuration') |
f3b14d052798
[pyro] merge pyro-id / pyro-instance-id options, put all pyro options in the same section of the configuration file
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2615
diff
changeset
|
24 |
config.input_config('pyro', 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""" |