author | Sandrine Ribeau <sandrine.ribeau@logilab.fr> |
Thu, 16 Jul 2009 12:57:17 -0700 | |
changeset 2541 | 09615ea7533e |
parent 1977 | 606923dff11b |
child 2476 | 1294a6bdf3bf |
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 |
|
0 | 15 |
# compute application's root directory |
16 |
APPLROOT = dirname(abspath(__file__)) |
|
17 |
# apply monkey patches first |
|
18 |
goa.do_monkey_patch() |
|
19 |
# get application's configuration (will be loaded from app.conf file) |
|
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' |