6 :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr |
6 :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr |
7 :license: GNU Lesser General Public License, v2.1 - http://www.gnu.org/licenses |
7 :license: GNU Lesser General Public License, v2.1 - http://www.gnu.org/licenses |
8 """ |
8 """ |
9 __docformat__ = "restructuredtext en" |
9 __docformat__ = "restructuredtext en" |
10 |
10 |
|
11 from cubicweb import underline_title |
11 from cubicweb.toolsutils import CommandHandler, confirm |
12 from cubicweb.toolsutils import CommandHandler, confirm |
12 |
13 |
13 |
14 |
14 class WebCreateHandler(CommandHandler): |
15 class WebCreateHandler(CommandHandler): |
15 cmdname = 'create' |
16 cmdname = 'create' |
16 |
17 |
17 def bootstrap(self, cubes, inputlevel=0): |
18 def bootstrap(self, cubes, inputlevel=0): |
18 """bootstrap this configuration""" |
19 """bootstrap this configuration""" |
19 print '** generic web configuration' |
20 print '\n'+underline_title('Generic web configuration') |
20 config = self.config |
21 config = self.config |
21 if config.repo_method == 'pyro': |
22 if config.repo_method == 'pyro': |
22 print |
23 print '\n'+underline_title('Repository server configuration') |
23 print '** repository server configuration' |
|
24 print '-' * 72 |
|
25 config.input_config('pyro-client', inputlevel) |
24 config.input_config('pyro-client', inputlevel) |
26 if confirm('allow anonymous access', False): |
25 if confirm('Allow anonymous access ?', False): |
27 config.global_set_option('anonymous-user', 'anon') |
26 config.global_set_option('anonymous-user', 'anon') |
28 config.global_set_option('anonymous-password', 'anon') |
27 config.global_set_option('anonymous-password', 'anon') |
29 |
28 |
30 def postcreate(self): |
29 def postcreate(self): |
31 """hooks called once application's initialization has been completed""" |
30 """hooks called once application's initialization has been completed""" |