author | Alexandre Fayolle <alexandre.fayolle@logilab.fr> |
Thu, 22 Apr 2010 19:48:04 +0000 | |
branch | stable |
changeset 5377 | 84d14ddfae13 |
parent 5344 | ed4cd1ca96d6 |
child 5421 | 8167de96c523 |
permissions | -rw-r--r-- |
0 | 1 |
"""cubicweb on appengine plugins for cubicweb-ctl |
2 |
||
3 |
:organization: Logilab |
|
4212
ab6573088b4a
update copyright: welcome 2010
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
3273
diff
changeset
|
4 |
:copyright: 2008-2010 LOGILAB S.A. (Paris, FRANCE), license is LGPL v2. |
0 | 5 |
:contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr |
1977
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 |
0 | 7 |
""" |
8 |
__docformat__ = "restructuredtext en" |
|
9 |
||
1132 | 10 |
from os.path import exists, join, split, basename, normpath, abspath |
11 |
from logilab.common.clcommands import register_commands |
|
0 | 12 |
|
1138
22f634977c95
make pylint happy, fix some bugs on the way
sylvain.thenault@logilab.fr
parents:
1133
diff
changeset
|
13 |
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
|
14 |
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
|
15 |
create_dir) |
0 | 16 |
from cubicweb.cwconfig import CubicWebConfiguration |
17 |
||
18 |
||
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
|
19 |
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
|
20 |
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
|
21 |
try: |
84d14ddfae13
[python2.6] prefer python2.6's builtin json module over simplejson
Alexandre Fayolle <alexandre.fayolle@logilab.fr>
parents:
5344
diff
changeset
|
22 |
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
|
23 |
except ImportError: |
84d14ddfae13
[python2.6] prefer python2.6's builtin json module over simplejson
Alexandre Fayolle <alexandre.fayolle@logilab.fr>
parents:
5344
diff
changeset
|
24 |
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
|
25 |
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
|
26 |
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
|
27 |
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
|
28 |
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
|
29 |
(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
|
30 |
(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
|
31 |
(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
|
32 |
(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
|
33 |
(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
|
34 |
(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
|
35 |
(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
|
36 |
(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
|
37 |
(roman.__file__.replace('.pyc', '.py'), 'roman.py'), |
0 | 38 |
|
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
|
39 |
('/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
|
40 |
|
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 |
(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
|
42 |
(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
|
43 |
(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
|
44 |
(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
|
45 |
(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
|
46 |
] |
0 | 47 |
|
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
|
48 |
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
|
49 |
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
|
50 |
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
|
51 |
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
|
52 |
(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
|
53 |
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
|
54 |
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
|
55 |
return dirs |
0 | 56 |
|
57 |
COPY_CW_FILES = ( |
|
58 |
'__init__.py', |
|
59 |
'__pkginfo__.py', |
|
60 |
'_exceptions.py', |
|
812 | 61 |
'appobject.py', |
0 | 62 |
'dbapi.py', |
63 |
'cwvreg.py', |
|
64 |
'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
|
65 |
'entity.py', |
0 | 66 |
'interfaces.py', |
4021
280c910c8710
move i18n / migration modules from cw.common to cw
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
3293
diff
changeset
|
67 |
'i18n.py', |
4023
eae23c40627a
drop common subpackage
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4021
diff
changeset
|
68 |
'mail.py', |
4021
280c910c8710
move i18n / migration modules from cw.common to cw
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
3293
diff
changeset
|
69 |
'migration.py', |
4023
eae23c40627a
drop common subpackage
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4021
diff
changeset
|
70 |
'mixins.py', |
eae23c40627a
drop common subpackage
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4021
diff
changeset
|
71 |
'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
|
72 |
'rqlrewrite.py', |
0 | 73 |
'rset.py', |
74 |
'schema.py', |
|
75 |
'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
|
76 |
'selectors.py', |
4023
eae23c40627a
drop common subpackage
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4021
diff
changeset
|
77 |
'uilib.py', |
812 | 78 |
'utils.py', |
0 | 79 |
'vregistry.py', |
812 | 80 |
'view.py', |
1802
d628defebc17
delete-trailing-whitespace + some copyright update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1432
diff
changeset
|
81 |
|
812 | 82 |
'ext/html4zope.py', |
83 |
'ext/rest.py', |
|
0 | 84 |
|
85 |
'server/hookhelper.py', |
|
86 |
'server/hooksmanager.py', |
|
87 |
'server/hooks.py', |
|
88 |
'server/migractions.py', |
|
89 |
'server/pool.py', |
|
90 |
'server/querier.py', |
|
91 |
'server/repository.py', |
|
92 |
'server/securityhooks.py', |
|
93 |
'server/session.py', |
|
94 |
'server/serverconfig.py', |
|
95 |
'server/ssplanner.py', |
|
96 |
'server/utils.py', |
|
97 |
'server/sources/__init__.py', |
|
98 |
||
99 |
'entities/__init__.py', |
|
100 |
'entities/authobjs.py', |
|
101 |
'entities/lib.py', |
|
102 |
'entities/schemaobjs.py', |
|
11
db9c539e0b1b
Add module wfobjs to enable workflow in gae.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
3
diff
changeset
|
103 |
'entities/wfobjs.py', |
0 | 104 |
|
105 |
'sobjects/__init__.py', |
|
106 |
'sobjects/notification.py', |
|
1802
d628defebc17
delete-trailing-whitespace + some copyright update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1432
diff
changeset
|
107 |
|
0 | 108 |
# XXX would be necessary for goa.testlib but require more stuff to be added |
109 |
# such as server.serverconfig and so on (check devtools.__init__) |
|
110 |
# 'devtools/__init__.py', |
|
111 |
# 'devtools/fake.py', |
|
1802
d628defebc17
delete-trailing-whitespace + some copyright update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1432
diff
changeset
|
112 |
|
0 | 113 |
'web/__init__.py', |
114 |
'web/_exceptions.py', |
|
115 |
'web/action.py', |
|
116 |
'web/application.py', |
|
117 |
'web/box.py', |
|
118 |
'web/component.py', |
|
119 |
'web/controller.py', |
|
120 |
'web/form.py', |
|
121 |
'web/htmlwidgets.py', |
|
122 |
'web/httpcache.py', |
|
123 |
'web/request.py', |
|
124 |
'web/webconfig.py', |
|
125 |
||
126 |
'web/views/__init__.py', |
|
127 |
'web/views/actions.py', |
|
128 |
'web/views/basecomponents.py', |
|
129 |
'web/views/basecontrollers.py', |
|
130 |
'web/views/baseforms.py', |
|
131 |
'web/views/basetemplates.py', |
|
132 |
'web/views/baseviews.py', |
|
133 |
'web/views/boxes.py', |
|
134 |
'web/views/calendar.py', |
|
135 |
'web/views/error.py', |
|
136 |
'web/views/editcontroller.py', |
|
137 |
'web/views/ibreadcrumbs.py', |
|
138 |
'web/views/idownloadable.py', |
|
139 |
'web/views/magicsearch.py', |
|
140 |
'web/views/management.py', |
|
141 |
'web/views/navigation.py', |
|
142 |
'web/views/startup.py', |
|
11
db9c539e0b1b
Add module wfobjs to enable workflow in gae.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
3
diff
changeset
|
143 |
'web/views/vcard.py', |
0 | 144 |
'web/views/wdoc.py', |
145 |
'web/views/urlpublishing.py', |
|
146 |
'web/views/urlrewrite.py', |
|
147 |
'web/views/xbel.py', |
|
148 |
||
149 |
'wsgi/__init__.py', |
|
150 |
'wsgi/handler.py', |
|
151 |
'wsgi/request.py', |
|
1802
d628defebc17
delete-trailing-whitespace + some copyright update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1432
diff
changeset
|
152 |
|
0 | 153 |
'goa/__init__.py', |
154 |
'goa/db.py', |
|
155 |
'goa/dbinit.py', |
|
156 |
'goa/dbmyams.py', |
|
157 |
'goa/goaconfig.py', |
|
158 |
'goa/goavreg.py', |
|
159 |
'goa/gaesource.py', |
|
160 |
'goa/rqlinterpreter.py', |
|
161 |
'goa/appobjects/__init__.py', |
|
1802
d628defebc17
delete-trailing-whitespace + some copyright update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1432
diff
changeset
|
162 |
'goa/appobjects/components.py', |
d628defebc17
delete-trailing-whitespace + some copyright update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1432
diff
changeset
|
163 |
'goa/appobjects/dbmgmt.py', |
d628defebc17
delete-trailing-whitespace + some copyright update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1432
diff
changeset
|
164 |
'goa/appobjects/gauthservice.py', |
0 | 165 |
'goa/appobjects/sessions.py', |
166 |
||
167 |
'schemas/bootstrap.py', |
|
168 |
'schemas/base.py', |
|
169 |
) |
|
170 |
||
171 |
OVERRIDEN_FILES = ( |
|
172 |
('toolsutils.py', 'toolsutils.py'), |
|
4023
eae23c40627a
drop common subpackage
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4021
diff
changeset
|
173 |
('mttransforms.py', 'mttransforms.py'), |
0 | 174 |
('server__init__.py', 'server/__init__.py'), |
175 |
('rqlannotation.py', 'server/rqlannotation.py'), |
|
176 |
) |
|
177 |
||
178 |
||
179 |
def create_init_file(pkgdir, pkgname): |
|
180 |
open(join(pkgdir, '__init__.py'), 'w').write('"""%s pkg"""' % pkgname) |
|
181 |
||
182 |
||
183 |
class NewGoogleAppCommand(Command): |
|
2476
1294a6bdf3bf
application -> instance where it makes sense
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
184 |
"""Create a new google appengine instance. |
0 | 185 |
|
2476
1294a6bdf3bf
application -> instance where it makes sense
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
186 |
<instance directory> |
1294a6bdf3bf
application -> instance where it makes sense
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
187 |
the path to the appengine instance directory |
0 | 188 |
""" |
189 |
name = 'newgapp' |
|
2476
1294a6bdf3bf
application -> instance where it makes sense
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
190 |
arguments = '<instance directory>' |
1802
d628defebc17
delete-trailing-whitespace + some copyright update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1432
diff
changeset
|
191 |
|
0 | 192 |
def run(self, args): |
193 |
if len(args) != 1: |
|
194 |
raise BadCommandUsage("exactly one argument is expected") |
|
195 |
appldir, = args |
|
196 |
appldir = normpath(abspath(appldir)) |
|
197 |
appid = basename(appldir) |
|
198 |
context = {'appname': appid} |
|
2476
1294a6bdf3bf
application -> instance where it makes sense
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
199 |
# goa instance'skeleton |
0 | 200 |
copy_skeleton(join(CW_SOFTWARE_ROOT, 'goa', 'skel'), |
201 |
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
|
202 |
# 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
|
203 |
for directory, subdirectory in slink_directories(): |
0 | 204 |
subdirectory = join(appldir, subdirectory) |
205 |
if not exists(split(subdirectory)[0]): |
|
206 |
create_dir(split(subdirectory)[0]) |
|
207 |
create_symlink(directory, join(appldir, subdirectory)) |
|
208 |
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
|
209 |
# copy supported part of cubicweb |
0 | 210 |
create_dir(join(appldir, 'cubicweb')) |
211 |
for fpath in COPY_CW_FILES: |
|
212 |
target = join(appldir, 'cubicweb', fpath) |
|
213 |
if not exists(split(target)[0]): |
|
214 |
create_dir(split(target)[0]) |
|
215 |
create_symlink(join(CW_SOFTWARE_ROOT, fpath), target) |
|
216 |
# overriden files |
|
217 |
for fpath, subfpath in OVERRIDEN_FILES: |
|
218 |
create_symlink(join(CW_SOFTWARE_ROOT, 'goa', 'overrides', fpath), |
|
219 |
join(appldir, 'cubicweb', subfpath)) |
|
220 |
# link every supported components |
|
3
512e9bd0685a
Renaming error in symlink creation for GOA.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
0
diff
changeset
|
221 |
packagesdir = join(appldir, 'cubes') |
11
db9c539e0b1b
Add module wfobjs to enable workflow in gae.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
3
diff
changeset
|
222 |
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
|
223 |
for include in ('addressbook','basket', 'blog','folder', |
b5fdad9208f8
search for cubes in a list of directories
sylvain.thenault@logilab.fr
parents:
11
diff
changeset
|
224 |
'tag', 'comment', 'file', 'link', |
3
512e9bd0685a
Renaming error in symlink creation for GOA.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
0
diff
changeset
|
225 |
'mailinglist', 'person', 'task', 'zone', |
0 | 226 |
): |
1015
b5fdad9208f8
search for cubes in a list of directories
sylvain.thenault@logilab.fr
parents:
11
diff
changeset
|
227 |
create_symlink(CubicWebConfiguration.cube_dir(include), |
b5fdad9208f8
search for cubes in a list of directories
sylvain.thenault@logilab.fr
parents:
11
diff
changeset
|
228 |
join(packagesdir, include)) |
0 | 229 |
# generate sample config |
230 |
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
|
231 |
from cubicweb.migration import MigrationHelper |
0 | 232 |
config = GAEConfiguration(appid, appldir) |
233 |
if exists(config.main_config_file()): |
|
234 |
mih = MigrationHelper(config) |
|
235 |
mih.rewrite_configuration() |
|
236 |
else: |
|
237 |
config.save() |
|
238 |
||
239 |
||
240 |
register_commands((NewGoogleAppCommand, |
|
241 |
)) |