equal
deleted
inserted
replaced
24 from logilab.common.configuration import merge_options |
24 from logilab.common.configuration import merge_options |
25 |
25 |
26 from cubicweb.cwconfig import CONFIGURATIONS |
26 from cubicweb.cwconfig import CONFIGURATIONS |
27 from cubicweb.server.serverconfig import ServerConfiguration |
27 from cubicweb.server.serverconfig import ServerConfiguration |
28 from cubicweb.toolsutils import fill_templated_file |
28 from cubicweb.toolsutils import fill_templated_file |
29 from cubicweb.web.webconfig import BaseWebConfiguration |
29 from cubicweb.web.webconfig import BaseWebConfiguration, WebConfigurationBase |
30 |
30 |
31 |
31 |
32 def get_random_secret_key(): |
32 def get_random_secret_key(): |
33 """Return 50-character secret string""" |
33 """Return 50-character secret string""" |
34 chars = string.ascii_letters + string.digits |
34 chars = string.ascii_letters + string.digits |
65 } |
65 } |
66 fill_templated_file(template_fpath, target_fpath, context) |
66 fill_templated_file(template_fpath, target_fpath, context) |
67 |
67 |
68 |
68 |
69 CONFIGURATIONS.append(CubicWebPyramidConfiguration) |
69 CONFIGURATIONS.append(CubicWebPyramidConfiguration) |
|
70 |
|
71 |
|
72 class AllInOneConfiguration(WebConfigurationBase, ServerConfiguration): |
|
73 """repository and web instance in the same Pyramid process""" |
|
74 name = 'all-in-one' |
|
75 options = merge_options(( |
|
76 ('profile', |
|
77 {'type': 'string', |
|
78 'default': None, |
|
79 'help': 'profile code and use the specified file to store stats if this option is set', |
|
80 'group': 'web', 'level': 3, |
|
81 }), |
|
82 ) + WebConfigurationBase.options + ServerConfiguration.options |
|
83 ) |
|
84 |
|
85 cubicweb_appobject_path = ( |
|
86 WebConfigurationBase.cubicweb_appobject_path |
|
87 | ServerConfiguration.cubicweb_appobject_path |
|
88 ) |
|
89 cube_appobject_path = ( |
|
90 WebConfigurationBase.cube_appobject_path |
|
91 | ServerConfiguration.cube_appobject_path |
|
92 ) |
|
93 |
|
94 |
|
95 CONFIGURATIONS.append(AllInOneConfiguration) |