author | Adrien Di Mascio <Adrien.DiMascio@logilab.fr> |
Thu, 22 Oct 2009 09:30:10 +0200 | |
branch | stable |
changeset 3781 | c7ef58db0e4b |
parent 2476 | 1294a6bdf3bf |
child 4212 | ab6573088b4a |
permissions | -rw-r--r-- |
1977
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1802
diff
changeset
|
1 |
""" |
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1802
diff
changeset
|
2 |
|
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1802
diff
changeset
|
3 |
:organization: Logilab |
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1802
diff
changeset
|
4 |
:copyright: 2001-2009 LOGILAB S.A. (Paris, FRANCE), license is LGPL v2. |
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1802
diff
changeset
|
5 |
:contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr |
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1802
diff
changeset
|
6 |
:license: GNU Lesser General Public License, v2.1 - http://www.gnu.org/licenses |
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1802
diff
changeset
|
7 |
""" |
0 | 8 |
if __name__ == '__main__': |
9 |
||
10 |
from os.path import dirname, abspath |
|
11 |
from cubicweb import goa |
|
12 |
from cubicweb.goa.goaconfig import GAEConfiguration |
|
13 |
from cubicweb.goa.dbinit import create_user, create_groups |
|
1802
d628defebc17
delete-trailing-whitespace + some copyright update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
14 |
|
2476
1294a6bdf3bf
application -> instance where it makes sense
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
15 |
# compute instance's root directory |
0 | 16 |
APPLROOT = dirname(abspath(__file__)) |
17 |
# apply monkey patches first |
|
18 |
goa.do_monkey_patch() |
|
2476
1294a6bdf3bf
application -> instance where it makes sense
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
19 |
# get instance's configuration (will be loaded from app.conf file) |
0 | 20 |
GAEConfiguration.ext_resources['JAVASCRIPTS'].append('DATADIR/goa.js') |
21 |
config = GAEConfiguration('toto', APPLROOT) |
|
22 |
# create default groups |
|
23 |
create_groups() |
|
24 |
if not config['use-google-auth']: |
|
25 |
# create default admin |
|
26 |
create_user('admin', 'admin', ('managers', 'users')) |
|
27 |
# create anonymous user if specified |
|
28 |
anonlogin = config['anonymous-user'] |
|
29 |
if anonlogin: |
|
30 |
create_user(anonlogin, config['anonymous-password'], ('guests',)) |
|
31 |
print 'content initialized' |