author | Sylvain Thénault <sylvain.thenault@logilab.fr> |
Tue, 06 Jul 2010 17:15:25 +0200 | |
changeset 5909 | 9af8ac182f53 |
parent 5424 | 8ecbcbff9777 |
child 6145 | 528be1e059aa |
permissions | -rw-r--r-- |
5421
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
5377
diff
changeset
|
1 |
# copyright 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved. |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
5377
diff
changeset
|
2 |
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
5377
diff
changeset
|
3 |
# |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
5377
diff
changeset
|
4 |
# This file is part of CubicWeb. |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
5377
diff
changeset
|
5 |
# |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
5377
diff
changeset
|
6 |
# CubicWeb is free software: you can redistribute it and/or modify it under the |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
5377
diff
changeset
|
7 |
# terms of the GNU Lesser General Public License as published by the Free |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
5377
diff
changeset
|
8 |
# Software Foundation, either version 2.1 of the License, or (at your option) |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
5377
diff
changeset
|
9 |
# any later version. |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
5377
diff
changeset
|
10 |
# |
5424
8ecbcbff9777
replace logilab-common by CubicWeb in disclaimer
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
5421
diff
changeset
|
11 |
# CubicWeb is distributed in the hope that it will be useful, but WITHOUT |
5421
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
5377
diff
changeset
|
12 |
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
5377
diff
changeset
|
13 |
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
5377
diff
changeset
|
14 |
# details. |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
5377
diff
changeset
|
15 |
# |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
5377
diff
changeset
|
16 |
# You should have received a copy of the GNU Lesser General Public License along |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
5377
diff
changeset
|
17 |
# with CubicWeb. If not, see <http://www.gnu.org/licenses/>. |
0 | 18 |
"""cubicweb on appengine plugins for cubicweb-ctl |
19 |
||
20 |
""" |
|
21 |
__docformat__ = "restructuredtext en" |
|
22 |
||
1132 | 23 |
from os.path import exists, join, split, basename, normpath, abspath |
24 |
from logilab.common.clcommands import register_commands |
|
0 | 25 |
|
1138
22f634977c95
make pylint happy, fix some bugs on the way
sylvain.thenault@logilab.fr
parents:
1133
diff
changeset
|
26 |
from cubicweb import CW_SOFTWARE_ROOT, BadCommandUsage |
22f634977c95
make pylint happy, fix some bugs on the way
sylvain.thenault@logilab.fr
parents:
1133
diff
changeset
|
27 |
from cubicweb.toolsutils import (Command, copy_skeleton, create_symlink, |
22f634977c95
make pylint happy, fix some bugs on the way
sylvain.thenault@logilab.fr
parents:
1133
diff
changeset
|
28 |
create_dir) |
0 | 29 |
from cubicweb.cwconfig import CubicWebConfiguration |
30 |
||
31 |
||
4841
0b9a842ec4f7
move SLINK_DIRECTORIES creation to a function avoid unnecessary import (and kill that damed warning of psyco not being installed)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4688
diff
changeset
|
32 |
def slink_directories(): |
5377
84d14ddfae13
[python2.6] prefer python2.6's builtin json module over simplejson
Alexandre Fayolle <alexandre.fayolle@logilab.fr>
parents:
5344
diff
changeset
|
33 |
import rql, yams, yapps, docutils, roman |
84d14ddfae13
[python2.6] prefer python2.6's builtin json module over simplejson
Alexandre Fayolle <alexandre.fayolle@logilab.fr>
parents:
5344
diff
changeset
|
34 |
try: |
84d14ddfae13
[python2.6] prefer python2.6's builtin json module over simplejson
Alexandre Fayolle <alexandre.fayolle@logilab.fr>
parents:
5344
diff
changeset
|
35 |
import json as simplejson |
84d14ddfae13
[python2.6] prefer python2.6's builtin json module over simplejson
Alexandre Fayolle <alexandre.fayolle@logilab.fr>
parents:
5344
diff
changeset
|
36 |
except ImportError: |
84d14ddfae13
[python2.6] prefer python2.6's builtin json module over simplejson
Alexandre Fayolle <alexandre.fayolle@logilab.fr>
parents:
5344
diff
changeset
|
37 |
import simplejson |
4841
0b9a842ec4f7
move SLINK_DIRECTORIES creation to a function avoid unnecessary import (and kill that damed warning of psyco not being installed)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4688
diff
changeset
|
38 |
from logilab import common as lgc |
0b9a842ec4f7
move SLINK_DIRECTORIES creation to a function avoid unnecessary import (and kill that damed warning of psyco not being installed)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4688
diff
changeset
|
39 |
from logilab import constraint as lgcstr |
0b9a842ec4f7
move SLINK_DIRECTORIES creation to a function avoid unnecessary import (and kill that damed warning of psyco not being installed)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4688
diff
changeset
|
40 |
from logilab import mtconverter as lgmtc |
0b9a842ec4f7
move SLINK_DIRECTORIES creation to a function avoid unnecessary import (and kill that damed warning of psyco not being installed)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4688
diff
changeset
|
41 |
dirs = [ |
0b9a842ec4f7
move SLINK_DIRECTORIES creation to a function avoid unnecessary import (and kill that damed warning of psyco not being installed)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4688
diff
changeset
|
42 |
(lgc.__path__[0], 'logilab/common'), |
0b9a842ec4f7
move SLINK_DIRECTORIES creation to a function avoid unnecessary import (and kill that damed warning of psyco not being installed)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4688
diff
changeset
|
43 |
(lgmtc.__path__[0], 'logilab/mtconverter'), |
0b9a842ec4f7
move SLINK_DIRECTORIES creation to a function avoid unnecessary import (and kill that damed warning of psyco not being installed)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4688
diff
changeset
|
44 |
(lgcstr.__path__[0], 'logilab/constraint'), |
0b9a842ec4f7
move SLINK_DIRECTORIES creation to a function avoid unnecessary import (and kill that damed warning of psyco not being installed)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4688
diff
changeset
|
45 |
(rql.__path__[0], 'rql'), |
0b9a842ec4f7
move SLINK_DIRECTORIES creation to a function avoid unnecessary import (and kill that damed warning of psyco not being installed)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4688
diff
changeset
|
46 |
(simplejson.__path__[0], 'simplejson'), |
0b9a842ec4f7
move SLINK_DIRECTORIES creation to a function avoid unnecessary import (and kill that damed warning of psyco not being installed)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4688
diff
changeset
|
47 |
(yams.__path__[0], 'yams'), |
0b9a842ec4f7
move SLINK_DIRECTORIES creation to a function avoid unnecessary import (and kill that damed warning of psyco not being installed)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4688
diff
changeset
|
48 |
(yapps.__path__[0], 'yapps'), |
0b9a842ec4f7
move SLINK_DIRECTORIES creation to a function avoid unnecessary import (and kill that damed warning of psyco not being installed)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4688
diff
changeset
|
49 |
(docutils.__path__[0], 'docutils'), |
0b9a842ec4f7
move SLINK_DIRECTORIES creation to a function avoid unnecessary import (and kill that damed warning of psyco not being installed)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4688
diff
changeset
|
50 |
(roman.__file__.replace('.pyc', '.py'), 'roman.py'), |
0 | 51 |
|
4841
0b9a842ec4f7
move SLINK_DIRECTORIES creation to a function avoid unnecessary import (and kill that damed warning of psyco not being installed)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4688
diff
changeset
|
52 |
('/usr/share/fckeditor/', 'fckeditor'), |
0b9a842ec4f7
move SLINK_DIRECTORIES creation to a function avoid unnecessary import (and kill that damed warning of psyco not being installed)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4688
diff
changeset
|
53 |
|
0b9a842ec4f7
move SLINK_DIRECTORIES creation to a function avoid unnecessary import (and kill that damed warning of psyco not being installed)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4688
diff
changeset
|
54 |
(join(CW_SOFTWARE_ROOT, 'web', 'data'), join('cubes', 'shared', 'data')), |
0b9a842ec4f7
move SLINK_DIRECTORIES creation to a function avoid unnecessary import (and kill that damed warning of psyco not being installed)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4688
diff
changeset
|
55 |
(join(CW_SOFTWARE_ROOT, 'web', 'wdoc'), join('cubes', 'shared', 'wdoc')), |
0b9a842ec4f7
move SLINK_DIRECTORIES creation to a function avoid unnecessary import (and kill that damed warning of psyco not being installed)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4688
diff
changeset
|
56 |
(join(CW_SOFTWARE_ROOT, 'i18n'), join('cubes', 'shared', 'i18n')), |
0b9a842ec4f7
move SLINK_DIRECTORIES creation to a function avoid unnecessary import (and kill that damed warning of psyco not being installed)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4688
diff
changeset
|
57 |
(join(CW_SOFTWARE_ROOT, 'goa', 'tools'), 'tools'), |
0b9a842ec4f7
move SLINK_DIRECTORIES creation to a function avoid unnecessary import (and kill that damed warning of psyco not being installed)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4688
diff
changeset
|
58 |
(join(CW_SOFTWARE_ROOT, 'goa', 'bin'), 'bin'), |
0b9a842ec4f7
move SLINK_DIRECTORIES creation to a function avoid unnecessary import (and kill that damed warning of psyco not being installed)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4688
diff
changeset
|
59 |
] |
0 | 60 |
|
4841
0b9a842ec4f7
move SLINK_DIRECTORIES creation to a function avoid unnecessary import (and kill that damed warning of psyco not being installed)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4688
diff
changeset
|
61 |
try: |
0b9a842ec4f7
move SLINK_DIRECTORIES creation to a function avoid unnecessary import (and kill that damed warning of psyco not being installed)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4688
diff
changeset
|
62 |
import dateutil |
0b9a842ec4f7
move SLINK_DIRECTORIES creation to a function avoid unnecessary import (and kill that damed warning of psyco not being installed)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4688
diff
changeset
|
63 |
import vobject |
0b9a842ec4f7
move SLINK_DIRECTORIES creation to a function avoid unnecessary import (and kill that damed warning of psyco not being installed)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4688
diff
changeset
|
64 |
dirs.extend([ (dateutil.__path__[0], 'dateutil'), |
0b9a842ec4f7
move SLINK_DIRECTORIES creation to a function avoid unnecessary import (and kill that damed warning of psyco not being installed)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4688
diff
changeset
|
65 |
(vobject.__path__[0], 'vobject') ] ) |
0b9a842ec4f7
move SLINK_DIRECTORIES creation to a function avoid unnecessary import (and kill that damed warning of psyco not being installed)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4688
diff
changeset
|
66 |
except ImportError: |
0b9a842ec4f7
move SLINK_DIRECTORIES creation to a function avoid unnecessary import (and kill that damed warning of psyco not being installed)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4688
diff
changeset
|
67 |
pass |
0b9a842ec4f7
move SLINK_DIRECTORIES creation to a function avoid unnecessary import (and kill that damed warning of psyco not being installed)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4688
diff
changeset
|
68 |
return dirs |
0 | 69 |
|
70 |
COPY_CW_FILES = ( |
|
71 |
'__init__.py', |
|
72 |
'__pkginfo__.py', |
|
73 |
'_exceptions.py', |
|
812 | 74 |
'appobject.py', |
0 | 75 |
'dbapi.py', |
76 |
'cwvreg.py', |
|
77 |
'cwconfig.py', |
|
713
5adb6d8e5fa7
update imports of "cubicweb.common.entity" and use the new module path "cubicweb.entity"
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
692
diff
changeset
|
78 |
'entity.py', |
0 | 79 |
'interfaces.py', |
4021
280c910c8710
move i18n / migration modules from cw.common to cw
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
3293
diff
changeset
|
80 |
'i18n.py', |
4023
eae23c40627a
drop common subpackage
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4021
diff
changeset
|
81 |
'mail.py', |
4021
280c910c8710
move i18n / migration modules from cw.common to cw
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
3293
diff
changeset
|
82 |
'migration.py', |
4023
eae23c40627a
drop common subpackage
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4021
diff
changeset
|
83 |
'mixins.py', |
eae23c40627a
drop common subpackage
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4021
diff
changeset
|
84 |
'mttransforms.py', |
3240
8604a15995d1
refactor so that rql rewriter may be used outside the server. Enhance it to be usable for RRQLExpression as well
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2476
diff
changeset
|
85 |
'rqlrewrite.py', |
0 | 86 |
'rset.py', |
87 |
'schema.py', |
|
88 |
'schemaviewer.py', |
|
692
800592b8d39b
replace deprecated cubicweb.common.selectors by its new module path (cubicweb.selectors)
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
11
diff
changeset
|
89 |
'selectors.py', |
4023
eae23c40627a
drop common subpackage
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4021
diff
changeset
|
90 |
'uilib.py', |
812 | 91 |
'utils.py', |
0 | 92 |
'vregistry.py', |
812 | 93 |
'view.py', |
1802
d628defebc17
delete-trailing-whitespace + some copyright update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1432
diff
changeset
|
94 |
|
812 | 95 |
'ext/html4zope.py', |
96 |
'ext/rest.py', |
|
0 | 97 |
|
98 |
'server/hookhelper.py', |
|
99 |
'server/hooksmanager.py', |
|
100 |
'server/hooks.py', |
|
101 |
'server/migractions.py', |
|
102 |
'server/pool.py', |
|
103 |
'server/querier.py', |
|
104 |
'server/repository.py', |
|
105 |
'server/securityhooks.py', |
|
106 |
'server/session.py', |
|
107 |
'server/serverconfig.py', |
|
108 |
'server/ssplanner.py', |
|
109 |
'server/utils.py', |
|
110 |
'server/sources/__init__.py', |
|
111 |
||
112 |
'entities/__init__.py', |
|
113 |
'entities/authobjs.py', |
|
114 |
'entities/lib.py', |
|
115 |
'entities/schemaobjs.py', |
|
11
db9c539e0b1b
Add module wfobjs to enable workflow in gae.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
3
diff
changeset
|
116 |
'entities/wfobjs.py', |
0 | 117 |
|
118 |
'sobjects/__init__.py', |
|
119 |
'sobjects/notification.py', |
|
1802
d628defebc17
delete-trailing-whitespace + some copyright update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1432
diff
changeset
|
120 |
|
0 | 121 |
# XXX would be necessary for goa.testlib but require more stuff to be added |
122 |
# such as server.serverconfig and so on (check devtools.__init__) |
|
123 |
# 'devtools/__init__.py', |
|
124 |
# 'devtools/fake.py', |
|
1802
d628defebc17
delete-trailing-whitespace + some copyright update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1432
diff
changeset
|
125 |
|
0 | 126 |
'web/__init__.py', |
127 |
'web/_exceptions.py', |
|
128 |
'web/action.py', |
|
129 |
'web/application.py', |
|
130 |
'web/box.py', |
|
131 |
'web/component.py', |
|
132 |
'web/controller.py', |
|
133 |
'web/form.py', |
|
134 |
'web/htmlwidgets.py', |
|
135 |
'web/httpcache.py', |
|
136 |
'web/request.py', |
|
137 |
'web/webconfig.py', |
|
138 |
||
139 |
'web/views/__init__.py', |
|
140 |
'web/views/actions.py', |
|
141 |
'web/views/basecomponents.py', |
|
142 |
'web/views/basecontrollers.py', |
|
143 |
'web/views/baseforms.py', |
|
144 |
'web/views/basetemplates.py', |
|
145 |
'web/views/baseviews.py', |
|
146 |
'web/views/boxes.py', |
|
147 |
'web/views/calendar.py', |
|
148 |
'web/views/error.py', |
|
149 |
'web/views/editcontroller.py', |
|
150 |
'web/views/ibreadcrumbs.py', |
|
151 |
'web/views/idownloadable.py', |
|
152 |
'web/views/magicsearch.py', |
|
153 |
'web/views/management.py', |
|
154 |
'web/views/navigation.py', |
|
155 |
'web/views/startup.py', |
|
11
db9c539e0b1b
Add module wfobjs to enable workflow in gae.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
3
diff
changeset
|
156 |
'web/views/vcard.py', |
0 | 157 |
'web/views/wdoc.py', |
158 |
'web/views/urlpublishing.py', |
|
159 |
'web/views/urlrewrite.py', |
|
160 |
'web/views/xbel.py', |
|
161 |
||
162 |
'wsgi/__init__.py', |
|
163 |
'wsgi/handler.py', |
|
164 |
'wsgi/request.py', |
|
1802
d628defebc17
delete-trailing-whitespace + some copyright update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1432
diff
changeset
|
165 |
|
0 | 166 |
'goa/__init__.py', |
167 |
'goa/db.py', |
|
168 |
'goa/dbinit.py', |
|
169 |
'goa/dbmyams.py', |
|
170 |
'goa/goaconfig.py', |
|
171 |
'goa/goavreg.py', |
|
172 |
'goa/gaesource.py', |
|
173 |
'goa/rqlinterpreter.py', |
|
174 |
'goa/appobjects/__init__.py', |
|
1802
d628defebc17
delete-trailing-whitespace + some copyright update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1432
diff
changeset
|
175 |
'goa/appobjects/components.py', |
d628defebc17
delete-trailing-whitespace + some copyright update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1432
diff
changeset
|
176 |
'goa/appobjects/dbmgmt.py', |
d628defebc17
delete-trailing-whitespace + some copyright update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1432
diff
changeset
|
177 |
'goa/appobjects/gauthservice.py', |
0 | 178 |
'goa/appobjects/sessions.py', |
179 |
||
180 |
'schemas/bootstrap.py', |
|
181 |
'schemas/base.py', |
|
182 |
) |
|
183 |
||
184 |
OVERRIDEN_FILES = ( |
|
185 |
('toolsutils.py', 'toolsutils.py'), |
|
4023
eae23c40627a
drop common subpackage
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4021
diff
changeset
|
186 |
('mttransforms.py', 'mttransforms.py'), |
0 | 187 |
('server__init__.py', 'server/__init__.py'), |
188 |
('rqlannotation.py', 'server/rqlannotation.py'), |
|
189 |
) |
|
190 |
||
191 |
||
192 |
def create_init_file(pkgdir, pkgname): |
|
193 |
open(join(pkgdir, '__init__.py'), 'w').write('"""%s pkg"""' % pkgname) |
|
194 |
||
195 |
||
196 |
class NewGoogleAppCommand(Command): |
|
2476
1294a6bdf3bf
application -> instance where it makes sense
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
197 |
"""Create a new google appengine instance. |
0 | 198 |
|
2476
1294a6bdf3bf
application -> instance where it makes sense
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
199 |
<instance directory> |
1294a6bdf3bf
application -> instance where it makes sense
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
200 |
the path to the appengine instance directory |
0 | 201 |
""" |
202 |
name = 'newgapp' |
|
2476
1294a6bdf3bf
application -> instance where it makes sense
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
203 |
arguments = '<instance directory>' |
1802
d628defebc17
delete-trailing-whitespace + some copyright update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1432
diff
changeset
|
204 |
|
0 | 205 |
def run(self, args): |
206 |
if len(args) != 1: |
|
207 |
raise BadCommandUsage("exactly one argument is expected") |
|
208 |
appldir, = args |
|
209 |
appldir = normpath(abspath(appldir)) |
|
210 |
appid = basename(appldir) |
|
211 |
context = {'appname': appid} |
|
2476
1294a6bdf3bf
application -> instance where it makes sense
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
212 |
# goa instance'skeleton |
0 | 213 |
copy_skeleton(join(CW_SOFTWARE_ROOT, 'goa', 'skel'), |
214 |
appldir, context, askconfirm=True) |
|
5344
ed4cd1ca96d6
[skeleton/dependencies] fix typo & new cube generation from template
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
4841
diff
changeset
|
215 |
# cubicweb core dependencies |
4841
0b9a842ec4f7
move SLINK_DIRECTORIES creation to a function avoid unnecessary import (and kill that damed warning of psyco not being installed)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4688
diff
changeset
|
216 |
for directory, subdirectory in slink_directories(): |
0 | 217 |
subdirectory = join(appldir, subdirectory) |
218 |
if not exists(split(subdirectory)[0]): |
|
219 |
create_dir(split(subdirectory)[0]) |
|
220 |
create_symlink(directory, join(appldir, subdirectory)) |
|
221 |
create_init_file(join(appldir, 'logilab'), 'logilab') |
|
1802
d628defebc17
delete-trailing-whitespace + some copyright update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1432
diff
changeset
|
222 |
# copy supported part of cubicweb |
0 | 223 |
create_dir(join(appldir, 'cubicweb')) |
224 |
for fpath in COPY_CW_FILES: |
|
225 |
target = join(appldir, 'cubicweb', fpath) |
|
226 |
if not exists(split(target)[0]): |
|
227 |
create_dir(split(target)[0]) |
|
228 |
create_symlink(join(CW_SOFTWARE_ROOT, fpath), target) |
|
229 |
# overriden files |
|
230 |
for fpath, subfpath in OVERRIDEN_FILES: |
|
231 |
create_symlink(join(CW_SOFTWARE_ROOT, 'goa', 'overrides', fpath), |
|
232 |
join(appldir, 'cubicweb', subfpath)) |
|
233 |
# link every supported components |
|
3
512e9bd0685a
Renaming error in symlink creation for GOA.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
0
diff
changeset
|
234 |
packagesdir = join(appldir, 'cubes') |
11
db9c539e0b1b
Add module wfobjs to enable workflow in gae.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
3
diff
changeset
|
235 |
create_init_file(join(appldir, 'cubes'), 'cubes') |
1015
b5fdad9208f8
search for cubes in a list of directories
sylvain.thenault@logilab.fr
parents:
11
diff
changeset
|
236 |
for include in ('addressbook','basket', 'blog','folder', |
b5fdad9208f8
search for cubes in a list of directories
sylvain.thenault@logilab.fr
parents:
11
diff
changeset
|
237 |
'tag', 'comment', 'file', 'link', |
3
512e9bd0685a
Renaming error in symlink creation for GOA.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
0
diff
changeset
|
238 |
'mailinglist', 'person', 'task', 'zone', |
0 | 239 |
): |
1015
b5fdad9208f8
search for cubes in a list of directories
sylvain.thenault@logilab.fr
parents:
11
diff
changeset
|
240 |
create_symlink(CubicWebConfiguration.cube_dir(include), |
b5fdad9208f8
search for cubes in a list of directories
sylvain.thenault@logilab.fr
parents:
11
diff
changeset
|
241 |
join(packagesdir, include)) |
0 | 242 |
# generate sample config |
243 |
from cubicweb.goa.goaconfig import GAEConfiguration |
|
4021
280c910c8710
move i18n / migration modules from cw.common to cw
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
3293
diff
changeset
|
244 |
from cubicweb.migration import MigrationHelper |
0 | 245 |
config = GAEConfiguration(appid, appldir) |
246 |
if exists(config.main_config_file()): |
|
247 |
mih = MigrationHelper(config) |
|
248 |
mih.rewrite_configuration() |
|
249 |
else: |
|
250 |
config.save() |
|
251 |
||
252 |
||
253 |
register_commands((NewGoogleAppCommand, |
|
254 |
)) |