author | Sylvain Thénault <sylvain.thenault@logilab.fr> |
Fri, 10 Jul 2009 12:15:09 +0200 | |
branch | stable |
changeset 2369 | 5a2b8ed266ca |
parent 1977 | 606923dff11b |
child 2395 | e3093fc12a00 |
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 |
||
601
a9e65aff3049
ask if anonymous should be allowed, configure accordingly
sylvain.thenault@logilab.fr
parents:
0
diff
changeset
|
11 |
from cubicweb.toolsutils import CommandHandler, confirm |
0 | 12 |
|
13 |
||
14 |
class WebCreateHandler(CommandHandler): |
|
15 |
cmdname = 'create' |
|
1802
d628defebc17
delete-trailing-whitespace + some copyright update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1132
diff
changeset
|
16 |
|
0 | 17 |
def bootstrap(self, cubes, inputlevel=0): |
18 |
"""bootstrap this configuration""" |
|
19 |
print '** generic web configuration' |
|
20 |
config = self.config |
|
21 |
if config.repo_method == 'pyro': |
|
22 |
print |
|
23 |
print '** repository server configuration' |
|
24 |
print '-' * 72 |
|
25 |
config.input_config('pyro-client', inputlevel) |
|
601
a9e65aff3049
ask if anonymous should be allowed, configure accordingly
sylvain.thenault@logilab.fr
parents:
0
diff
changeset
|
26 |
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
|
27 |
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
|
28 |
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
|
29 |
|
0 | 30 |
def postcreate(self): |
31 |
"""hooks called once application's initialization has been completed""" |