author | Sylvain Thénault <sylvain.thenault@logilab.fr> |
Wed, 29 Jul 2009 09:08:26 +0200 | |
changeset 2550 | 4e009026a0f0 |
parent 2476 | 1294a6bdf3bf |
child 2615 | 1ea41b7c0836 |
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 |
601
a9e65aff3049
ask if anonymous should be allowed, configure accordingly
sylvain.thenault@logilab.fr
parents:
0
diff
changeset
|
12 |
from cubicweb.toolsutils import CommandHandler, confirm |
0 | 13 |
|
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) |
2395
e3093fc12a00
[cw-ctl] improve dialog messages
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
1977
diff
changeset
|
25 |
if 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""" |