Merge lp:~therp-nl/anybox.recipe.openerp/jbaudoux-relative_paths_resolve_conflict into lp:~jbaudoux/anybox.recipe.openerp/20130908_relative_paths
- jbaudoux-relative_paths_resolve_conflict
- Merge into 20130908_relative_paths
Proposed by
Stefan Rijnhart (Opener)
Status: | Work in progress |
---|---|
Proposed branch: | lp:~therp-nl/anybox.recipe.openerp/jbaudoux-relative_paths_resolve_conflict |
Merge into: | lp:~jbaudoux/anybox.recipe.openerp/20130908_relative_paths |
Diff against target: |
5948 lines (+3990/-991) 57 files modified
.bzrignore (+1/-0) CHANGES.rst (+45/-5) MANIFEST.in (+1/-0) README.rst (+75/-0) anybox/recipe/openerp/base.py (+49/-31) anybox/recipe/openerp/runtime/__init__.py (+39/-0) anybox/recipe/openerp/runtime/backports/__init__.py (+1/-0) anybox/recipe/openerp/runtime/backports/cli/__init__.py (+1/-0) anybox/recipe/openerp/runtime/backports/cli/server.py (+87/-0) anybox/recipe/openerp/runtime/session.py (+317/-31) anybox/recipe/openerp/runtime/start_openerp.py (+43/-1) anybox/recipe/openerp/runtime/tests/__init__.py (+1/-0) anybox/recipe/openerp/runtime/tests/test_import_registry.py (+1/-1) anybox/recipe/openerp/runtime/upgrade.py (+153/-0) anybox/recipe/openerp/server.py (+50/-7) anybox/recipe/openerp/tests/test_server.py (+3/-3) anybox/recipe/openerp/tests/test_utils.py (+25/-0) anybox/recipe/openerp/upgrade.py.tmpl (+19/-0) anybox/recipe/openerp/utils.py (+34/-7) anybox/recipe/openerp/vcs/bzr.py (+9/-2) anybox/recipe/openerp/vcs/git.py (+2/-1) anybox/recipe/openerp/vcs/tests/test_bzr.py (+33/-3) anybox/recipe/openerp/vcs/tests/test_git.py (+3/-0) buildbot/MANIFEST.cfg (+56/-27) buildbot/base_recipe.cfg (+24/-0) buildbot/recipe-50.cfg (+1/-18) buildbot/recipe-60-custom.cfg (+9/-18) buildbot/recipe-60.cfg (+2/-11) buildbot/recipe-61-custom.cfg (+2/-12) buildbot/recipe-61.cfg (+1/-10) buildbot/recipe-7.0.cfg (+1/-12) buildbot/recipe-latest.cfg (+2/-11) buildbot/recipe-nightly.cfg (+1/-10) buildbot/recipe-trunk.cfg (+1/-11) buildbot/stable-recipe-50.cfg (+4/-0) buildbot/stable-recipe-60.cfg (+4/-0) buildbot/stable-recipe-61.cfg (+4/-0) buildbot/stable-recipe-7.0.cfg (+0/-42) buildbot/stable-recipe-nightly.cfg (+4/-0) doc/Makefile (+177/-0) doc/apidoc/anybox.recipe.openerp.rst (+75/-0) doc/apidoc/anybox.recipe.openerp.runtime.rst (+50/-0) doc/apidoc/anybox.recipe.openerp.vcs.rst (+59/-0) doc/conf.py (+247/-0) doc/configuration.rst (+613/-713) doc/contributing.rst (+187/-0) doc/dev_prod_workflow.rst (+32/-0) doc/first_steps.rst (+351/-0) doc/index.rst (+79/-0) doc/scripts.rst (+471/-0) doc/sphinx_static/default.css (+267/-0) doc/sphinx_templates/layout.html (+203/-0) setup.py (+5/-3) test-cover (+1/-1) tests_with_openerp/README.txt (+1/-0) tests_with_openerp/data/VERSION.txt (+5/-0) tests_with_openerp/test_version.py (+59/-0) |
To merge this branch: | bzr merge lp:~therp-nl/anybox.recipe.openerp/jbaudoux-relative_paths_resolve_conflict |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jacques-Etienne Baudoux | Pending | ||
Review via email: mp+205084@code.launchpad.net |
Commit message
Description of the change
Update with trunk branch to resolve a small conflict (ll.1200-1202 in the diff).
To post a comment you must log in.
- 425. By Stefan Rijnhart (Opener)
-
[FIX] Use unquoted substitution
Unmerged revisions
- 425. By Stefan Rijnhart (Opener)
-
[FIX] Use unquoted substitution
- 424. By Stefan Rijnhart (Opener)
-
[MRG] Update with target branch
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file '.bzrignore' | |||
2 | --- .bzrignore 2013-09-07 12:04:02 +0000 | |||
3 | +++ .bzrignore 2014-02-06 07:42:46 +0000 | |||
4 | @@ -11,3 +11,4 @@ | |||
5 | 11 | buildbot/develop-eggs/ | 11 | buildbot/develop-eggs/ |
6 | 12 | buildbot/etc/ | 12 | buildbot/etc/ |
7 | 13 | buildbot/parts/ | 13 | buildbot/parts/ |
8 | 14 | doc/sphinx_build | ||
9 | 14 | 15 | ||
10 | === modified file 'CHANGES.rst' | |||
11 | --- CHANGES.rst 2013-09-07 11:43:18 +0000 | |||
12 | +++ CHANGES.rst 2014-02-06 07:42:46 +0000 | |||
13 | @@ -1,13 +1,53 @@ | |||
14 | 1 | Changes | 1 | Changes |
15 | 2 | ~~~~~~~ | 2 | ~~~~~~~ |
16 | 3 | 3 | ||
19 | 4 | 1.8.0 (unreleased) | 4 | The 1.7 series are stable versions, while the 1.8 are unstable. |
20 | 5 | ------------------ | 5 | Changes displayed as "unreleased" in th stable series are released |
21 | 6 | with any higher released unstable versions. | ||
22 | 7 | |||
23 | 8 | 1.8.2 (unreleased) | ||
24 | 9 | ------------------ | ||
25 | 10 | - launchpad #1275168: when freeze nightly version was not set correctly | ||
26 | 11 | - launchpad #1245261: new ``--init-all`` option in ``test_openerp`` | ||
27 | 12 | and ``start_openerp`` scripts. | ||
28 | 13 | |||
29 | 14 | 1.8.1 (2013-10-17) | ||
30 | 15 | ------------------ | ||
31 | 16 | - launchpad #1235946 (demo data): consistent behaviour and capability | ||
32 | 17 | to load them. | ||
33 | 18 | - launchpad #1239721: now session has 'is_initialization' attribute for | ||
34 | 19 | creation use-cases of upgrade script; using it to improve logging, | ||
35 | 20 | and in default upgrade script. | ||
36 | 21 | |||
37 | 22 | |||
38 | 23 | 1.8.0 (2013-10-01) | ||
39 | 24 | ------------------ | ||
40 | 25 | - launchpad #1222482: upgrade toolkit and upgrade scripts generation | ||
41 | 6 | - launchpad #1222116: [Gunicorn] option to preload databases | 26 | - launchpad #1222116: [Gunicorn] option to preload databases |
42 | 7 | 27 | ||
46 | 8 | 1.7.2 (unreleased) | 28 | 1.7.4 (unreleased) |
47 | 9 | ------------------ | 29 | ------------------ |
48 | 10 | 30 | - launchpad #1246822: restored the ordering of addons_path as it was | |
49 | 31 | in 1.7.0 (main addons first). | ||
50 | 32 | |||
51 | 33 | 1.7.3 (2013-10-17) | ||
52 | 34 | ------------------ | ||
53 | 35 | - Fixed the licence in ``setup.py`` and hence on PyPI page. The ZPL | ||
54 | 36 | indicated was contradictory with what is stated on Launchpad's | ||
55 | 37 | project page, and plain non applicable, since the recipe *does* import | ||
56 | 38 | from OpenERP. | ||
57 | 39 | - launchpad #1232806: custom interpreter and openerp_scripts now work | ||
58 | 40 | with OpenERP 6.1 | ||
59 | 41 | - launchpad #1233606: [bzr] lightweight checkout now respects --offline | ||
60 | 42 | |||
61 | 43 | 1.7.2 (2013-09-29) | ||
62 | 44 | ------------------ | ||
63 | 45 | - launchpad #1232724: [gunicorn] properly switching openerp to | ||
64 | 46 | multi-process mode | ||
65 | 47 | - SAAS versions now recognized, and treated as X.5 | ||
66 | 48 | - launchpad #1228997: [v5] in some cases, start_openerp --stop-after-init was | ||
67 | 49 | not honoured. | ||
68 | 50 | - launchpad #1222562: [git] error in extract-downloads-to | ||
69 | 11 | 51 | ||
70 | 12 | 1.7.1 (2013-09-07) | 52 | 1.7.1 (2013-09-07) |
71 | 13 | ------------------ | 53 | ------------------ |
72 | 14 | 54 | ||
73 | === modified file 'MANIFEST.in' | |||
74 | --- MANIFEST.in 2012-11-07 18:41:15 +0000 | |||
75 | +++ MANIFEST.in 2014-02-06 07:42:46 +0000 | |||
76 | @@ -2,3 +2,4 @@ | |||
77 | 2 | include anybox/recipe/openerp/openerp-cron-worker | 2 | include anybox/recipe/openerp/openerp-cron-worker |
78 | 3 | include buildbot/*.cfg | 3 | include buildbot/*.cfg |
79 | 4 | include buildbot/bootstrap.py | 4 | include buildbot/bootstrap.py |
80 | 5 | include anybox/recipe/openerp/upgrade.py.tmpl | ||
81 | 5 | \ No newline at end of file | 6 | \ No newline at end of file |
82 | 6 | 7 | ||
83 | === added file 'README.rst' | |||
84 | --- README.rst 1970-01-01 00:00:00 +0000 | |||
85 | +++ README.rst 2014-02-06 07:42:46 +0000 | |||
86 | @@ -0,0 +1,75 @@ | |||
87 | 1 | OpenERP buildout recipe | ||
88 | 2 | ======================= | ||
89 | 3 | This recipe for `Buildout <https://github.com/buildout/buildout>`_ is | ||
90 | 4 | a fully featured tool allowing you to define and deploy quickly | ||
91 | 5 | OpenERP installations of any kinds, ranging from development setups to | ||
92 | 6 | fully automated production deployments or continuous integration. | ||
93 | 7 | |||
94 | 8 | Some of its main features include: | ||
95 | 9 | |||
96 | 10 | * uniformity across OpenERP versions (from 5.0 onwards) | ||
97 | 11 | * installation of OpenERP server and, if meaningful, GTK and web clients. | ||
98 | 12 | * retrieval of main software and addons from various sources, | ||
99 | 13 | including the major version control systems | ||
100 | 14 | * ability to pinpoint everything for replayability | ||
101 | 15 | * management of OpenERP configuration | ||
102 | 16 | * dedicated scripts creation for easy integration of external tools, | ||
103 | 17 | such as test launchers | ||
104 | 18 | * packaging: creation of self-contained equivalents for easy | ||
105 | 19 | deployment in tightly controlled hosting environmenents. | ||
106 | 20 | |||
107 | 21 | All these to be considered together with zc.buildout‘s general | ||
108 | 22 | properties, such as an extensible configuration file format for easy | ||
109 | 23 | variation or separation of concerns, native Python distributions | ||
110 | 24 | installation, and of course the huge ecosystem of other recipes. | ||
111 | 25 | |||
112 | 26 | The `full documentation | ||
113 | 27 | <http://pythonhosted.org/anybox.recipe.openerp>`_ | ||
114 | 28 | is written with `Sphinx | ||
115 | 29 | <http://sphinx-doc.org>`_, built continuously and | ||
116 | 30 | uploaded to http://docs.anybox.fr/anybox.recipe.openerp by Anybox' public | ||
117 | 31 | buildbot. | ||
118 | 32 | The Sphinx source tree is to be found under the ``doc`` subdirectory | ||
119 | 33 | of this project. | ||
120 | 34 | |||
121 | 35 | The latest released version of the documentation is uploaded to PyPI | ||
122 | 36 | alongside with the package. See `PyPIDocumentationHosting | ||
123 | 37 | <https://wiki.python.org/moin/PyPiDocumentationHosting>`_ for details. | ||
124 | 38 | |||
125 | 39 | Bug reports and Feedback | ||
126 | 40 | ~~~~~~~~~~~~~~~~~~~~~~~~ | ||
127 | 41 | Please don't hesitate to give feedback and especially report bugs or | ||
128 | 42 | ask for new features through launchpad at this URL: | ||
129 | 43 | https://bugs.launchpad.net/anybox.recipe.openerp/+bugs | ||
130 | 44 | |||
131 | 45 | Useful links | ||
132 | 46 | ~~~~~~~~~~~~ | ||
133 | 47 | |||
134 | 48 | * Code repository and bug tracker: https://launchpad.net/anybox.recipe.openerp | ||
135 | 49 | * PyPI page: http://pypi.python.org/pypi/anybox.recipe.openerp | ||
136 | 50 | * Main documentation: http://docs.anybox.fr/anybox.recipe.openerp | ||
137 | 51 | |||
138 | 52 | |||
139 | 53 | Contributors information | ||
140 | 54 | ~~~~~~~~~~~~~~~~~~~~~~~~ | ||
141 | 55 | |||
142 | 56 | See `the latest version of the contributors documentation | ||
143 | 57 | <http://docs.anybox.fr/anybox.recipe.openerp/trunk/contributing.html>`_. | ||
144 | 58 | |||
145 | 59 | |||
146 | 60 | Credits | ||
147 | 61 | ~~~~~~~ | ||
148 | 62 | |||
149 | 63 | Authors: | ||
150 | 64 | |||
151 | 65 | * Christophe Combelles | ||
152 | 66 | * Georges Racinet | ||
153 | 67 | |||
154 | 68 | Contributors: | ||
155 | 69 | |||
156 | 70 | * Jean-Sébastien Suzanne | ||
157 | 71 | * Yannick Vaucher | ||
158 | 72 | * Jacques-Etienne Baudoux | ||
159 | 73 | * Laurent Mignon | ||
160 | 74 | * Leonardo Pistone | ||
161 | 75 | |||
162 | 0 | 76 | ||
163 | === modified file 'anybox/recipe/openerp/base.py' | |||
164 | --- anybox/recipe/openerp/base.py 2013-09-08 13:48:02 +0000 | |||
165 | +++ anybox/recipe/openerp/base.py 2014-02-06 07:42:46 +0000 | |||
166 | @@ -37,6 +37,13 @@ | |||
167 | 37 | 37 | ||
168 | 38 | class MainSoftware(object): | 38 | class MainSoftware(object): |
169 | 39 | """Placeholder to represent the main software instead of an addon location. | 39 | """Placeholder to represent the main software instead of an addon location. |
170 | 40 | |||
171 | 41 | Should just have a singleton instance: :data:`main_software`, | ||
172 | 42 | whose meaning depends on the concrete recipe class using it. | ||
173 | 43 | |||
174 | 44 | For example, in :class:`anybox.recipe.openerp.server.ServerRecipe`, | ||
175 | 45 | :data:`main_software` represents the OpenObject server or the OpenERP | ||
176 | 46 | standard distribution. | ||
177 | 40 | """ | 47 | """ |
178 | 41 | 48 | ||
179 | 42 | def __str__(self): | 49 | def __str__(self): |
180 | @@ -51,24 +58,32 @@ | |||
181 | 51 | """Base class for other recipes. | 58 | """Base class for other recipes. |
182 | 52 | 59 | ||
183 | 53 | It implements notably fetching of the main software part plus addons. | 60 | It implements notably fetching of the main software part plus addons. |
202 | 54 | The ``sources`` attributes is a dict storing how to fetch the main software | 61 | |
203 | 55 | part and specified addons. It has the following structure: | 62 | The :attr:`sources` attribute is a ``dict`` storing how to fetch the main |
204 | 56 | 63 | software part and the specified addons, with the following structure: | |
205 | 57 | local path -> (type, location_spec, options). | 64 | |
206 | 58 | 65 | ``local path -> (type, location_spec, options)``, in which: | |
207 | 59 | where local path is the ``main_software`` object for the main software | 66 | |
208 | 60 | part, and otherwise a local path to an addons container. | 67 | :local path: is either the :data:`main_software` singleton |
209 | 61 | 68 | (see :class:`MainSoftware`) or a local path to an | |
210 | 62 | type can be | 69 | addons directory. |
211 | 63 | - 'local' | 70 | :type: can be either |
212 | 64 | - 'downloadable' | 71 | |
213 | 65 | - one of the supported vcs | 72 | * ``'local'`` |
214 | 66 | 73 | * ``'downloadable'`` | |
215 | 67 | location_spec is, depending on the type, a tuple specifying how to | 74 | * one of the supported vcs |
216 | 68 | fetch : (url, None), or (vcs_url, vcs_revision) or None | 75 | |
217 | 69 | 76 | :location_spec: is, depending on the type, a tuple specifying how | |
218 | 70 | addons options are typically used to specify that the addons directory | 77 | fetch is to be done: |
219 | 71 | is actually a subdir of the specified one. | 78 | |
220 | 79 | ``(url, None)``, or ``(vcs_url, vcs_revision)`` | ||
221 | 80 | or ``None`` | ||
222 | 81 | :addons options: are typically used to specify that the addons | ||
223 | 82 | directory is actually a subdir of the specified one. | ||
224 | 83 | |||
225 | 84 | VCS support classes (see | ||
226 | 85 | :mod:`anybox.recipe.openerp.vcs`) can implemented their | ||
227 | 86 | dedicated options | ||
228 | 72 | 87 | ||
229 | 73 | """ | 88 | """ |
230 | 74 | 89 | ||
231 | @@ -164,7 +179,7 @@ | |||
232 | 164 | self.parse_revisions(options) | 179 | self.parse_revisions(options) |
233 | 165 | 180 | ||
234 | 166 | def parse_version(self): | 181 | def parse_version(self): |
236 | 167 | """Set the main software in ``sources`` and related attributes. | 182 | """Set the main software in :attr:`sources` and related attributes. |
237 | 168 | """ | 183 | """ |
238 | 169 | self.version_wanted = self.options.get('version') | 184 | self.version_wanted = self.options.get('version') |
239 | 170 | if self.version_wanted is None: | 185 | if self.version_wanted is None: |
240 | @@ -438,9 +453,9 @@ | |||
241 | 438 | os.putenv('PYTHONPATH', pythonpath_bak) | 453 | os.putenv('PYTHONPATH', pythonpath_bak) |
242 | 439 | 454 | ||
243 | 440 | def parse_addons(self, options): | 455 | def parse_addons(self, options): |
245 | 441 | """Parse the addons options into the ``sources`` attribute. | 456 | """Parse the addons options into :attr:`sources`. |
246 | 442 | 457 | ||
248 | 443 | See ``BaseRecipe`` docstring for details about the ``sources`` dict. | 458 | See :class:`BaseRecipe` for the structure of :attr:`sources`. |
249 | 444 | """ | 459 | """ |
250 | 445 | 460 | ||
251 | 446 | for line in options.get('addons', '').split(os.linesep): | 461 | for line in options.get('addons', '').split(os.linesep): |
252 | @@ -462,11 +477,13 @@ | |||
253 | 462 | self.sources[addons_dir] = (loc_type, location_spec, options) | 477 | self.sources[addons_dir] = (loc_type, location_spec, options) |
254 | 463 | 478 | ||
255 | 464 | def parse_revisions(self, options): | 479 | def parse_revisions(self, options): |
257 | 465 | """Parse revisions options and update the ``sources`` attribute. | 480 | """Parse revisions options and update :attr:`sources`. |
258 | 466 | 481 | ||
261 | 467 | It is assumed that ``sources`` has already been populated, and | 482 | It is assumed that :attr:`sources` has already been populated, and |
262 | 468 | notably has a main_software part. | 483 | notably has a :data:`main_software` entry. |
263 | 469 | This allows for easy fixing of revisions in an extension buildout | 484 | This allows for easy fixing of revisions in an extension buildout |
264 | 485 | |||
265 | 486 | See :class:`BaseRecipe` for the structure of :attr:`sources`. | ||
266 | 470 | """ | 487 | """ |
267 | 471 | for line in options.get('revisions', '').split(os.linesep): | 488 | for line in options.get('revisions', '').split(os.linesep): |
268 | 472 | # GR inline comment should have not gone through, but sometimes | 489 | # GR inline comment should have not gone through, but sometimes |
269 | @@ -505,11 +522,9 @@ | |||
270 | 505 | + source[2:]) | 522 | + source[2:]) |
271 | 506 | 523 | ||
272 | 507 | def retrieve_addons(self): | 524 | def retrieve_addons(self): |
274 | 508 | """Parse the addons option line, download and return a list of paths. | 525 | """Peform all lookup and downloads specified in :attr:`sources`. |
275 | 509 | 526 | ||
279 | 510 | syntax: repo_type repo_url repo_dir repo_rev [options] | 527 | See :class:`BaseRecipe` for the structure of :attr:`sources`. |
277 | 511 | or an absolute or relative path | ||
278 | 512 | options are themselves in the key=value form | ||
280 | 513 | """ | 528 | """ |
281 | 514 | self.addons_paths = [] | 529 | self.addons_paths = [] |
282 | 515 | for local_dir, source_spec in self.sources.items(): | 530 | for local_dir, source_spec in self.sources.items(): |
283 | @@ -623,7 +638,10 @@ | |||
284 | 623 | logger.info("No need to re-download %s", self.archive_path) | 638 | logger.info("No need to re-download %s", self.archive_path) |
285 | 624 | 639 | ||
286 | 625 | def retrieve_main_software(self): | 640 | def retrieve_main_software(self): |
288 | 626 | """install server, webclient or gtkclient.""" | 641 | """Lookup or fetch the main software. |
289 | 642 | |||
290 | 643 | See :class:`MainSoftware` and :class:`BaseRecipe` for explanations. | ||
291 | 644 | """ | ||
292 | 627 | 645 | ||
293 | 628 | source = self.sources[main_software] | 646 | source = self.sources[main_software] |
294 | 629 | type_spec = source[0] | 647 | type_spec = source[0] |
295 | @@ -751,7 +769,7 @@ | |||
296 | 751 | def dump_nightly_latest_version(self): | 769 | def dump_nightly_latest_version(self): |
297 | 752 | """After download/analysis of 'nightly latest', give equivalent spec. | 770 | """After download/analysis of 'nightly latest', give equivalent spec. |
298 | 753 | """ | 771 | """ |
300 | 754 | return ' '.join((self.nightly_series, 'nightly', self.nightly_version)) | 772 | return ' '.join(('nightly', self.nightly_series, self.nightly_version)) |
301 | 755 | 773 | ||
302 | 756 | def freeze_to(self, out_config_path): | 774 | def freeze_to(self, out_config_path): |
303 | 757 | """Create an extension buildout freezing current revisions & versions. | 775 | """Create an extension buildout freezing current revisions & versions. |
304 | @@ -1141,7 +1159,7 @@ | |||
305 | 1141 | else: | 1159 | else: |
306 | 1142 | base_addons = join(self.openerp_dir, 'openerp', 'addons') | 1160 | base_addons = join(self.openerp_dir, 'openerp', 'addons') |
307 | 1143 | if os.path.exists(base_addons): | 1161 | if os.path.exists(base_addons): |
309 | 1144 | self.addons_paths.append(base_addons) | 1162 | self.addons_paths.insert(0, base_addons) |
310 | 1145 | 1163 | ||
311 | 1146 | if check_existence: | 1164 | if check_existence: |
312 | 1147 | for path in self.addons_paths: | 1165 | for path in self.addons_paths: |
313 | 1148 | 1166 | ||
314 | === added directory 'anybox/recipe/openerp/runtime' | |||
315 | === added file 'anybox/recipe/openerp/runtime/__init__.py' | |||
316 | --- anybox/recipe/openerp/runtime/__init__.py 1970-01-01 00:00:00 +0000 | |||
317 | +++ anybox/recipe/openerp/runtime/__init__.py 2014-02-06 07:42:46 +0000 | |||
318 | @@ -0,0 +1,39 @@ | |||
319 | 1 | """ | ||
320 | 2 | Runtime | ||
321 | 3 | ======= | ||
322 | 4 | |||
323 | 5 | This subpackage provides encapsulations and entry points for the application | ||
324 | 6 | itself: | ||
325 | 7 | |||
326 | 8 | * the ``session`` module features the supporting objects for "OpenERP scripts" | ||
327 | 9 | and the dedicated python interpreter. | ||
328 | 10 | * the ``start_openerp`` and ``test_openerp`` modules are the entry points for | ||
329 | 11 | the main startup scripts. | ||
330 | 12 | |||
331 | 13 | This architecture is meant in particular to provide stability and uniformity | ||
332 | 14 | accross OpenERP major versions, so that the recipe can be leveraged by | ||
333 | 15 | automated deploymnent tools and continuous integration systems. | ||
334 | 16 | """ | ||
335 | 17 | |||
336 | 18 | _imported_addons = set() | ||
337 | 19 | |||
338 | 20 | |||
339 | 21 | def already_imported(module_name): | ||
340 | 22 | """Convenience to help some OpenERP modules to avoid been imported twice. | ||
341 | 23 | |||
342 | 24 | Each call of this function returns a boolean indicated whether the | ||
343 | 25 | specified module was already in the ``imported_addons`` registry and add it | ||
344 | 26 | inconditionnally. | ||
345 | 27 | |||
346 | 28 | Thus caller code is expected to import the module right away if the | ||
347 | 29 | return value was False. | ||
348 | 30 | """ | ||
349 | 31 | name = module_name.rsplit('.', 1)[-1] | ||
350 | 32 | if name in _imported_addons: | ||
351 | 33 | return True | ||
352 | 34 | _imported_addons.add(name) | ||
353 | 35 | return False | ||
354 | 36 | |||
355 | 37 | |||
356 | 38 | def clear_import_registry(): | ||
357 | 39 | _imported_addons.clear() | ||
358 | 0 | 40 | ||
359 | === added directory 'anybox/recipe/openerp/runtime/backports' | |||
360 | === added file 'anybox/recipe/openerp/runtime/backports/__init__.py' | |||
361 | --- anybox/recipe/openerp/runtime/backports/__init__.py 1970-01-01 00:00:00 +0000 | |||
362 | +++ anybox/recipe/openerp/runtime/backports/__init__.py 2014-02-06 07:42:46 +0000 | |||
363 | @@ -0,0 +1,1 @@ | |||
364 | 1 | # python package | ||
365 | 0 | 2 | ||
366 | === added directory 'anybox/recipe/openerp/runtime/backports/cli' | |||
367 | === added file 'anybox/recipe/openerp/runtime/backports/cli/__init__.py' | |||
368 | --- anybox/recipe/openerp/runtime/backports/cli/__init__.py 1970-01-01 00:00:00 +0000 | |||
369 | +++ anybox/recipe/openerp/runtime/backports/cli/__init__.py 2014-02-06 07:42:46 +0000 | |||
370 | @@ -0,0 +1,1 @@ | |||
371 | 1 | # python package | ||
372 | 0 | 2 | ||
373 | === added file 'anybox/recipe/openerp/runtime/backports/cli/server.py' | |||
374 | --- anybox/recipe/openerp/runtime/backports/cli/server.py 1970-01-01 00:00:00 +0000 | |||
375 | +++ anybox/recipe/openerp/runtime/backports/cli/server.py 2014-02-06 07:42:46 +0000 | |||
376 | @@ -0,0 +1,87 @@ | |||
377 | 1 | # -*- coding: utf-8 -*- | ||
378 | 2 | |||
379 | 3 | ############################################################################## | ||
380 | 4 | # | ||
381 | 5 | # OpenERP, Open Source Management Solution | ||
382 | 6 | # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). | ||
383 | 7 | # | ||
384 | 8 | # This program is free software: you can redistribute it and/or modify | ||
385 | 9 | # it under the terms of the GNU Affero General Public License as | ||
386 | 10 | # published by the Free Software Foundation, either version 3 of the | ||
387 | 11 | # License, or (at your option) any later version. | ||
388 | 12 | # | ||
389 | 13 | # This program is distributed in the hope that it will be useful, | ||
390 | 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
391 | 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
392 | 16 | # GNU Affero General Public License for more details. | ||
393 | 17 | # | ||
394 | 18 | # You should have received a copy of the GNU Affero General Public License | ||
395 | 19 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
396 | 20 | # | ||
397 | 21 | ############################################################################## | ||
398 | 22 | # | ||
399 | 23 | # anybox.recipe.openerp is also under AGPL v3+ | ||
400 | 24 | # | ||
401 | 25 | |||
402 | 26 | """ | ||
403 | 27 | Copied from OpenERP 6.1's openerp-server startup script. | ||
404 | 28 | |||
405 | 29 | This makes utilitary functions available to the session module. | ||
406 | 30 | """ | ||
407 | 31 | |||
408 | 32 | import logging | ||
409 | 33 | import os | ||
410 | 34 | import sys | ||
411 | 35 | |||
412 | 36 | try: | ||
413 | 37 | import openerp | ||
414 | 38 | except: | ||
415 | 39 | # this file must stay importable by nose tests | ||
416 | 40 | pass | ||
417 | 41 | else: | ||
418 | 42 | __author__ = openerp.release.author | ||
419 | 43 | __version__ = openerp.release.version | ||
420 | 44 | |||
421 | 45 | if openerp.release.version_info < (6, 1): | ||
422 | 46 | raise RuntimeError("Interpreter and scripts not compatible " | ||
423 | 47 | "with OpenERP < 6.1") | ||
424 | 48 | |||
425 | 49 | # Also use the `openerp` logger for the main script. | ||
426 | 50 | _logger = logging.getLogger('openerp') | ||
427 | 51 | |||
428 | 52 | |||
429 | 53 | def check_root_user(): | ||
430 | 54 | """ Exit if the process's user is 'root' (on POSIX system).""" | ||
431 | 55 | if os.name == 'posix': | ||
432 | 56 | import pwd | ||
433 | 57 | if pwd.getpwuid(os.getuid())[0] == 'root': | ||
434 | 58 | sys.stderr.write("Running as user 'root' is a security risk, " | ||
435 | 59 | "aborting.\n") | ||
436 | 60 | sys.exit(1) | ||
437 | 61 | |||
438 | 62 | |||
439 | 63 | def check_postgres_user(): | ||
440 | 64 | """ Exit if the configured database user is 'postgres'. | ||
441 | 65 | |||
442 | 66 | This function assumes the configuration has been initialized. | ||
443 | 67 | """ | ||
444 | 68 | config = openerp.tools.config | ||
445 | 69 | if config['db_user'] == 'postgres': | ||
446 | 70 | sys.stderr.write("Using the database user 'postgres' is a " | ||
447 | 71 | "security risk, aborting.") | ||
448 | 72 | sys.exit(1) | ||
449 | 73 | |||
450 | 74 | |||
451 | 75 | def report_configuration(): | ||
452 | 76 | """ Log the server version and some configuration values. | ||
453 | 77 | |||
454 | 78 | This function assumes the configuration has been initialized. | ||
455 | 79 | """ | ||
456 | 80 | config = openerp.tools.config | ||
457 | 81 | _logger.info("OpenERP version %s", __version__) | ||
458 | 82 | for name, value in [('addons paths', config['addons_path']), | ||
459 | 83 | ('database hostname', | ||
460 | 84 | config['db_host'] or 'localhost'), | ||
461 | 85 | ('database port', config['db_port'] or '5432'), | ||
462 | 86 | ('database user', config['db_user'])]: | ||
463 | 87 | _logger.info("%s: %s", name, value) | ||
464 | 0 | 88 | ||
465 | === renamed file 'anybox/recipe/openerp/patch_openerp_v5.py' => 'anybox/recipe/openerp/runtime/patch_openerp_v5.py' | |||
466 | === renamed file 'anybox/recipe/openerp/startup.py' => 'anybox/recipe/openerp/runtime/session.py' | |||
467 | --- anybox/recipe/openerp/startup.py 2013-07-24 15:59:29 +0000 | |||
468 | +++ anybox/recipe/openerp/runtime/session.py 2014-02-06 07:42:46 +0000 | |||
469 | @@ -1,69 +1,369 @@ | |||
470 | 1 | """Utilities to start a server process.""" | 1 | """Utilities to start a server process.""" |
471 | 2 | import warnings | 2 | import warnings |
472 | 3 | import sys | 3 | import sys |
473 | 4 | import os | ||
474 | 4 | import logging | 5 | import logging |
475 | 6 | from distutils.version import Version | ||
476 | 7 | |||
477 | 8 | |||
478 | 5 | try: | 9 | try: |
479 | 6 | import openerp | 10 | import openerp |
480 | 7 | except ImportError: | 11 | except ImportError: |
481 | 8 | warnings.warn("This must be imported with a buildout openerp recipe " | 12 | warnings.warn("This must be imported with a buildout openerp recipe " |
482 | 9 | "driven sys.path", RuntimeWarning) | 13 | "driven sys.path", RuntimeWarning) |
483 | 10 | else: | 14 | else: |
485 | 11 | from openerp.cli import server as startup | 15 | try: |
486 | 16 | from openerp.cli import server as startup | ||
487 | 17 | except ImportError: | ||
488 | 18 | from .backports.cli import server as startup | ||
489 | 12 | from openerp.tools import config | 19 | from openerp.tools import config |
490 | 20 | from openerp import SUPERUSER_ID | ||
491 | 21 | from openerp.tools.parse_version import parse_version | ||
492 | 22 | |||
493 | 13 | from optparse import OptionParser # we support python >= 2.6 | 23 | from optparse import OptionParser # we support python >= 2.6 |
494 | 14 | 24 | ||
495 | 15 | logger = logging.getLogger(__name__) | 25 | logger = logging.getLogger(__name__) |
496 | 16 | 26 | ||
497 | 27 | DEFAULT_VERSION_PARAMETER = 'buildout.db_version' | ||
498 | 28 | |||
499 | 29 | DEFAULT_VERSION_FILE = 'VERSION.txt' | ||
500 | 30 | |||
501 | 31 | |||
502 | 32 | class OpenERPVersion(Version): | ||
503 | 33 | """OpenERP idea of version, wrapped in a class. | ||
504 | 34 | |||
505 | 35 | This is based on :meth:`openerp.tools.parse_version`, and | ||
506 | 36 | Provides straight-ahead comparison with tuples of integers, or | ||
507 | 37 | distutils Version classes. | ||
508 | 38 | """ | ||
509 | 39 | |||
510 | 40 | def parse(self, incoming): | ||
511 | 41 | if isinstance(incoming, OpenERPVersion): | ||
512 | 42 | self.vstring = incoming.vstring | ||
513 | 43 | self.components = incoming.components | ||
514 | 44 | else: | ||
515 | 45 | self.vstring = incoming | ||
516 | 46 | self.components = parse_version(incoming) | ||
517 | 47 | |||
518 | 48 | def __str__(self): | ||
519 | 49 | return self.vstring | ||
520 | 50 | |||
521 | 51 | def __repr__(self): | ||
522 | 52 | return 'OpenERPVersion(%r)' % str(self) | ||
523 | 53 | |||
524 | 54 | def __cmp__(self, other): | ||
525 | 55 | if isinstance(other, tuple): | ||
526 | 56 | other = '.'.join(str(s) for s in other) | ||
527 | 57 | elif not isinstance(other, self.__class__): | ||
528 | 58 | other = str(other) # Works with distutils' Version classes | ||
529 | 59 | |||
530 | 60 | other = self.__class__(other) | ||
531 | 61 | return cmp(self.components, other.components) | ||
532 | 62 | |||
533 | 17 | 63 | ||
534 | 18 | class Session(object): | 64 | class Session(object): |
544 | 19 | """A class to represent the server object. | 65 | """A class to give server-level access to one database. |
545 | 20 | 66 | ||
546 | 21 | you should have exactly one per process. | 67 | There should be exactly one instance of this class per process. |
547 | 22 | 68 | It can be used for any kind of script involving OpenERP API, and provides | |
548 | 23 | Before actual use, call the ``bootstrap`` method. | 69 | facilities for upgrade scripts (see also |
549 | 24 | Then you have useful attributes/methods behaving like unit test classes: | 70 | :mod:anybox.recipe.openerp.runtime.upgrade) |
550 | 25 | 71 | ||
551 | 26 | self.cr: a cursor | 72 | Before actual use, call :meth:`open`. |
552 | 27 | self.uid: user id | 73 | Then you'll have useful attributes and methods reminiscent of the unit test |
553 | 74 | classes: | ||
554 | 75 | |||
555 | 76 | * :attr:`cr`: a cursor | ||
556 | 77 | * :attr:`uid`: user id | ||
557 | 78 | * :attr:`registry`: access to model objects | ||
558 | 79 | * :attr:`is_initialization`: True if and only if the database was not | ||
559 | 80 | initialized before the call to :meth:`open` | ||
560 | 81 | |||
561 | 82 | Example application code:: | ||
562 | 83 | |||
563 | 84 | session.open(db_name="my_db") | ||
564 | 85 | admin = session.registry('res_users').browse(session.cr, session.uid, 1) | ||
565 | 86 | (...) | ||
566 | 87 | session.cr.commit() | ||
567 | 88 | session.close() | ||
568 | 89 | |||
569 | 90 | Transaction management is up to user code | ||
570 | 91 | |||
571 | 92 | Upgrade scripts writers should check the version handling properties: | ||
572 | 93 | |||
573 | 94 | * :meth:`db_version` | ||
574 | 95 | * :meth:`package_version` | ||
575 | 96 | |||
576 | 97 | Instantiation is done by passing the path to OpenERP main | ||
577 | 98 | configuration file and the path of the buildout directory. | ||
578 | 99 | |||
579 | 100 | Usually, instantiation code is written by the recipe in the body of the | ||
580 | 101 | executable "OpenERP scripts" it produces. | ||
581 | 102 | Script writers provide a callable that takes a | ||
582 | 103 | :class:`.Session` object argument and declare it as a console script entry | ||
583 | 104 | point in their distribution. | ||
584 | 105 | End users can reference such entry points in their buildout configurations | ||
585 | 106 | to have buildout produce the actual executable. See :doc:`/scripts` | ||
586 | 107 | for details. | ||
587 | 108 | |||
588 | 109 | Upgrade scripts are a special case of that process, in which the entry | ||
589 | 110 | point is actually provided by the recipe and rewraps a user-level | ||
590 | 111 | source script. | ||
591 | 112 | |||
592 | 113 | Later versions of the recipe may find a way to pass the whole buildout | ||
593 | 114 | configuration (recall that this is to be used in a separate process in | ||
594 | 115 | which the buildout configuration has not been parsed). | ||
595 | 28 | """ | 116 | """ |
596 | 29 | 117 | ||
598 | 30 | def __init__(self, conffile): | 118 | def __init__(self, conffile, buildout_dir, parse_config=True): |
599 | 119 | self.buildout_dir = buildout_dir | ||
600 | 120 | self.openerp_config_file = conffile | ||
601 | 121 | |||
602 | 31 | self._registry = self.cr = None | 122 | self._registry = self.cr = None |
604 | 32 | config.parse_config(['-c', conffile]) | 123 | if parse_config: |
605 | 124 | config.parse_config(['-c', conffile]) | ||
606 | 33 | 125 | ||
607 | 34 | def ready(self): | 126 | def ready(self): |
608 | 35 | return self._registry is not None | 127 | return self._registry is not None |
609 | 36 | 128 | ||
611 | 37 | def open(self, db=None): | 129 | def open(self, db=None, with_demo=False): |
612 | 130 | """Load the database | ||
613 | 131 | |||
614 | 132 | Loading an empty database in OpenERP has the side effect of installing | ||
615 | 133 | the ``base`` module. Whether to loading demo data or not has therefore | ||
616 | 134 | to be decided right away. | ||
617 | 135 | |||
618 | 136 | :param db: database name. If not specified, the same cascading of | ||
619 | 137 | defaults as OpenERP mainstream will be applied: | ||
620 | 138 | configuration file, psycopg2/lipq defaults. | ||
621 | 139 | :param with_demo: controls the loading of demo data for all | ||
622 | 140 | module installations triggered by this call to | ||
623 | 141 | :meth:`open` and further uses of :meth:`load_modules` | ||
624 | 142 | on this :class:`Session` instance: | ||
625 | 143 | |||
626 | 144 | * if ``True``, demo data will uniformly be loaded | ||
627 | 145 | * if ``False``, no demo data will be loaded | ||
628 | 146 | * if ``None``, demo data will be loaded according to | ||
629 | 147 | the value of ``without_demo`` in configuration | ||
630 | 148 | |||
631 | 149 | In all cases, the behaviour will stay consistent | ||
632 | 150 | until the next call of ``open()``, but the | ||
633 | 151 | implementation does not protect against any race | ||
634 | 152 | conditions in OpenERP internals. | ||
635 | 153 | """ | ||
636 | 38 | if db is None: | 154 | if db is None: |
637 | 39 | db = config['db_name'] | 155 | db = config['db_name'] |
638 | 40 | if not db: | 156 | if not db: |
640 | 41 | db = '' # default to OpenERP/psycopg2/lipbq default behaviour | 157 | db = '' # expected value expected by OpenERP to start defaulting. |
641 | 158 | |||
642 | 159 | cnx = openerp.sql_db.db_connect(db) | ||
643 | 160 | cr = cnx.cursor() | ||
644 | 161 | self.is_initialization = not(openerp.modules.db.is_initialized(cr)) | ||
645 | 162 | cr.close() | ||
646 | 163 | |||
647 | 42 | startup.check_root_user() | 164 | startup.check_root_user() |
648 | 43 | startup.check_postgres_user() | 165 | startup.check_postgres_user() |
649 | 44 | openerp.netsvc.init_logger() | 166 | openerp.netsvc.init_logger() |
650 | 167 | |||
651 | 168 | saved_without_demo = config['without_demo'] | ||
652 | 169 | if with_demo is None: | ||
653 | 170 | with_demo = config['without_demo'] | ||
654 | 171 | |||
655 | 172 | config['without_demo'] = not with_demo | ||
656 | 173 | self.with_demo = with_demo | ||
657 | 174 | |||
658 | 45 | self._registry = openerp.modules.registry.RegistryManager.get( | 175 | self._registry = openerp.modules.registry.RegistryManager.get( |
659 | 46 | db, update_module=False) | 176 | db, update_module=False) |
660 | 177 | config['without_demo'] = saved_without_demo | ||
661 | 47 | self.init_cursor() | 178 | self.init_cursor() |
662 | 179 | self.uid = SUPERUSER_ID | ||
663 | 180 | |||
664 | 181 | # A later version might read that from buildout configuration. | ||
665 | 182 | _version_parameter_name = DEFAULT_VERSION_PARAMETER | ||
666 | 183 | |||
667 | 184 | @property | ||
668 | 185 | def version_file_path(self): | ||
669 | 186 | """Absolute path of the flat file storing the package version. | ||
670 | 187 | |||
671 | 188 | For now this is not configurable, a later version might read it | ||
672 | 189 | from buildout configuration. | ||
673 | 190 | """ | ||
674 | 191 | return os.path.join(self.buildout_dir, DEFAULT_VERSION_FILE) | ||
675 | 192 | |||
676 | 193 | def parse_version_string(self, vstring): | ||
677 | 194 | """Stable method for downstream code needing to instantiate a version. | ||
678 | 195 | |||
679 | 196 | This method returns an appropriate version instance, without | ||
680 | 197 | any dependency on where to import the class from. Especially useful | ||
681 | 198 | for applications whose life started before this set of utilities has | ||
682 | 199 | been used : this helps building an usable default. | ||
683 | 200 | """ | ||
684 | 201 | return OpenERPVersion(vstring) | ||
685 | 202 | |||
686 | 203 | @property | ||
687 | 204 | def db_version(self): | ||
688 | 205 | """Settable property for version stored in DB of the whole buildout. | ||
689 | 206 | |||
690 | 207 | This can be thought as the latest version to which the DB has been | ||
691 | 208 | upgraded to. | ||
692 | 209 | A simple caching system to avoid querying the DB multiple times is | ||
693 | 210 | implemented. | ||
694 | 211 | """ | ||
695 | 212 | db_version = getattr(self, '_db_version', None) | ||
696 | 213 | if db_version is not None: | ||
697 | 214 | return db_version | ||
698 | 215 | |||
699 | 216 | db_version = self.registry('ir.config_parameter').get_param( | ||
700 | 217 | self.cr, self.uid, self._version_parameter_name) | ||
701 | 218 | if not db_version: | ||
702 | 219 | # as usual OpenERP thinks its simpler to use False as None | ||
703 | 220 | # restoring sanity ASAP | ||
704 | 221 | db_version = None | ||
705 | 222 | else: | ||
706 | 223 | db_version = OpenERPVersion(db_version) | ||
707 | 224 | self._db_version = db_version | ||
708 | 225 | return db_version | ||
709 | 226 | |||
710 | 227 | @db_version.setter | ||
711 | 228 | def db_version(self, version): | ||
712 | 229 | self.registry('ir.config_parameter').set_param( | ||
713 | 230 | self.cr, self.uid, self._version_parameter_name, str(version)) | ||
714 | 231 | self._db_version = OpenERPVersion(version) | ||
715 | 232 | |||
716 | 233 | @property | ||
717 | 234 | def package_version(self): | ||
718 | 235 | """Property reading the version file from buildout directory. | ||
719 | 236 | |||
720 | 237 | Comments introduced with a hash are accepted. | ||
721 | 238 | Only the first significant line is taken into account. | ||
722 | 239 | """ | ||
723 | 240 | pkg_version = getattr(self, '_pkg_version', None) | ||
724 | 241 | if pkg_version is not None: | ||
725 | 242 | return pkg_version | ||
726 | 243 | |||
727 | 244 | try: | ||
728 | 245 | with open(self.version_file_path) as f: | ||
729 | 246 | for line in f: | ||
730 | 247 | line = line.split('#', 1)[0].strip() | ||
731 | 248 | if not line: | ||
732 | 249 | continue | ||
733 | 250 | self._pkg_version = OpenERPVersion(line) | ||
734 | 251 | return self._pkg_version | ||
735 | 252 | except IOError: | ||
736 | 253 | logger.info("No version file could be read, " | ||
737 | 254 | "package version considered to be None") | ||
738 | 255 | |||
739 | 256 | def update_modules_list(self): | ||
740 | 257 | """Update the list of available OpenERP modules, like the UI allows to. | ||
741 | 258 | |||
742 | 259 | This is necessary prior to install of any new module. | ||
743 | 260 | """ | ||
744 | 261 | self.registry('ir.module.module').update_list(self.cr, self.uid) | ||
745 | 48 | 262 | ||
746 | 49 | def init_cursor(self): | 263 | def init_cursor(self): |
747 | 50 | self.cr = self._registry.db.cursor() | 264 | self.cr = self._registry.db.cursor() |
748 | 51 | 265 | ||
749 | 52 | def registry(self, model): | 266 | def registry(self, model): |
751 | 53 | """Return the model object.""" | 267 | """Lookup model by name and return a ready-to-work instance.""" |
752 | 54 | return self._registry.get(model) | 268 | return self._registry.get(model) |
753 | 55 | 269 | ||
754 | 56 | def rollback(self): | 270 | def rollback(self): |
755 | 57 | self.cr.rollback() | 271 | self.cr.rollback() |
756 | 58 | 272 | ||
757 | 59 | def close(self): | 273 | def close(self): |
758 | 274 | """Close the cursor and forget about the current database. | ||
759 | 275 | |||
760 | 276 | The session is thus ready to open another database. | ||
761 | 277 | """ | ||
762 | 278 | dbname = self.cr.dbname | ||
763 | 60 | self.cr.close() | 279 | self.cr.close() |
764 | 280 | openerp.modules.registry.RegistryManager.delete(dbname) | ||
765 | 281 | |||
766 | 282 | def update_modules(self, modules, db=None): | ||
767 | 283 | """Update the prescribed modules in the database. | ||
768 | 284 | |||
769 | 285 | :param db: Database name. If not specified, it is assumed to have | ||
770 | 286 | already been opened with :meth:`open`, e.g, for a prior | ||
771 | 287 | read of :meth:`db_version`. | ||
772 | 288 | If it is specified, then the session in particular opens | ||
773 | 289 | that db and will use it afterwards whether another one | ||
774 | 290 | was already opened or not. | ||
775 | 291 | :param modules: any iterable of module names. | ||
776 | 292 | Not installed modules will be ignored | ||
777 | 293 | The special name ``'all'`` triggers the update of | ||
778 | 294 | all installed modules. | ||
779 | 295 | """ | ||
780 | 296 | if db is None: | ||
781 | 297 | if self.cr is None: | ||
782 | 298 | raise ValueError("update_modules needs either the session to " | ||
783 | 299 | "be opened or an explicit database name") | ||
784 | 300 | db = self.cr.dbname | ||
785 | 301 | |||
786 | 302 | if self.cr is not None: | ||
787 | 303 | self.close() | ||
788 | 304 | for module in modules: | ||
789 | 305 | config['update'][module] = 1 | ||
790 | 306 | self._registry = openerp.modules.registry.RegistryManager.get( | ||
791 | 307 | db, update_module=True) | ||
792 | 308 | config['update'].clear() | ||
793 | 309 | self.init_cursor() | ||
794 | 310 | |||
795 | 311 | def install_modules(self, modules, db=None, update_modules_list=True, | ||
796 | 312 | open_with_demo=False): | ||
797 | 313 | """Install the modules in the database. | ||
798 | 314 | |||
799 | 315 | Has the side effect of closing the current cursor, committing if and | ||
800 | 316 | only if the list of modules is updated. | ||
801 | 317 | |||
802 | 318 | Demo data loading is handled consistently with the decision taken | ||
803 | 319 | by :meth:`open`. | ||
804 | 320 | |||
805 | 321 | :param db: Database name. If not specified, it is assumed to have | ||
806 | 322 | already been opened with :meth:`open`, e.g, for a prior | ||
807 | 323 | read of :meth:`db_version`. | ||
808 | 324 | If it is specified, then the session in particular opens | ||
809 | 325 | that db and will use it afterwards whether another one | ||
810 | 326 | was already opened or not. | ||
811 | 327 | :param modules: any iterable of module names. | ||
812 | 328 | :param update_modules_list: if True, will update the module lists | ||
813 | 329 | *and commit* before the install begins. | ||
814 | 330 | :param open_with_demo: if ``db`` is not None, will be passed to | ||
815 | 331 | :meth:`open`. | ||
816 | 332 | """ | ||
817 | 333 | already_open = self.cr is not None | ||
818 | 334 | if db is None: | ||
819 | 335 | if not already_open: | ||
820 | 336 | raise ValueError("install_modules needs either the session to " | ||
821 | 337 | "be opened or an explicit database name") | ||
822 | 338 | db = self.cr.dbname | ||
823 | 339 | elif update_modules_list and not ( | ||
824 | 340 | already_open and self.cr.dbname == db): | ||
825 | 341 | self.open(db=db, with_demo=open_with_demo) | ||
826 | 342 | |||
827 | 343 | if update_modules_list: | ||
828 | 344 | self.update_modules_list() | ||
829 | 345 | self.cr.commit() | ||
830 | 346 | |||
831 | 347 | if self.cr is not None: | ||
832 | 348 | self.close() | ||
833 | 349 | saved_without_demo = config['without_demo'] | ||
834 | 350 | |||
835 | 351 | # with update_modules_list=False, an explicitely named DB would not | ||
836 | 352 | # have gone through open() yet. | ||
837 | 353 | config['without_demo'] = not getattr(self, 'with_demo', open_with_demo) | ||
838 | 354 | for module in modules: | ||
839 | 355 | config['init'][module] = 1 | ||
840 | 356 | self._registry = openerp.modules.registry.RegistryManager.get( | ||
841 | 357 | db, update_module=True, force_demo=self.with_demo) | ||
842 | 358 | config['init'].clear() | ||
843 | 359 | config['without_demo'] = saved_without_demo | ||
844 | 360 | self.init_cursor() | ||
845 | 61 | 361 | ||
846 | 62 | def handle_command_line_options(self, to_handle): | 362 | def handle_command_line_options(self, to_handle): |
847 | 63 | """Handle prescribed command line options and eat them. | 363 | """Handle prescribed command line options and eat them. |
848 | 64 | 364 | ||
851 | 65 | Anything before first occurrence of '--' is ours and removed from | 365 | Anything before first occurrence of ``--`` on the command-line is taken |
852 | 66 | sys.argv. | 366 | into account and removed from ``sys.argv``. |
853 | 67 | 367 | ||
854 | 68 | Help messages: | 368 | Help messages: |
855 | 69 | 369 | ||
856 | @@ -118,17 +418,3 @@ | |||
857 | 118 | logger.info("No database specified, using the one specified " | 418 | logger.info("No database specified, using the one specified " |
858 | 119 | "in buildout configuration.") | 419 | "in buildout configuration.") |
859 | 120 | self.open(db=options.db_name) | 420 | self.open(db=options.db_name) |
860 | 121 | |||
861 | 122 | _imported_addons = set() | ||
862 | 123 | |||
863 | 124 | |||
864 | 125 | def already_imported(module_name): | ||
865 | 126 | name = module_name.rsplit('.', 1)[-1] | ||
866 | 127 | if name in _imported_addons: | ||
867 | 128 | return True | ||
868 | 129 | _imported_addons.add(name) | ||
869 | 130 | return False | ||
870 | 131 | |||
871 | 132 | |||
872 | 133 | def clear_import_registry(): | ||
873 | 134 | _imported_addons.clear() | ||
874 | 135 | 421 | ||
875 | === renamed file 'anybox/recipe/openerp/start_openerp.py' => 'anybox/recipe/openerp/runtime/start_openerp.py' | |||
876 | --- anybox/recipe/openerp/start_openerp.py 2013-08-04 18:23:29 +0000 | |||
877 | +++ anybox/recipe/openerp/runtime/start_openerp.py 2014-02-06 07:42:46 +0000 | |||
878 | @@ -1,14 +1,38 @@ | |||
879 | 1 | """This module bridges the classical ``openerp-server`` as a console script. | ||
880 | 2 | |||
881 | 3 | The :func:`main` function gets registered on the fly by the server recipe as | ||
882 | 4 | a console script entry point and used in particular for ``start_openerp`` and | ||
883 | 5 | ``test_openerp``. | ||
884 | 6 | |||
885 | 7 | Some version independence logic for the startup process also get bootstrapped | ||
886 | 8 | from here. | ||
887 | 9 | """ | ||
888 | 10 | |||
889 | 1 | import sys | 11 | import sys |
890 | 2 | import os | 12 | import os |
891 | 3 | from . import patch_openerp_v5 | 13 | from . import patch_openerp_v5 |
892 | 4 | 14 | ||
893 | 5 | 15 | ||
894 | 6 | def insert_args(arguments): | 16 | def insert_args(arguments): |
895 | 17 | """Insert `arguments` in ``sys.argv`` (direct impact on child script). | ||
896 | 18 | """ | ||
897 | 7 | for i, a in enumerate(arguments): | 19 | for i, a in enumerate(arguments): |
898 | 8 | sys.argv.insert(i+1, a) | 20 | sys.argv.insert(i+1, a) |
899 | 9 | 21 | ||
900 | 10 | 22 | ||
901 | 11 | def main(starter, conf, version=None, just_test=False): | 23 | def main(starter, conf, version=None, just_test=False): |
902 | 24 | """Call the `starter` script, dispatching configuration. | ||
903 | 25 | |||
904 | 26 | All arguments are set in the standalone script produced by buildout through | ||
905 | 27 | entry point options. | ||
906 | 28 | |||
907 | 29 | :param starter: path to the main script source file (currently | ||
908 | 30 | ``openerp-server``) | ||
909 | 31 | :param conf: path to the OpenERP configuration file (managed by the recipe) | ||
910 | 32 | :param version: OpenERP major version | ||
911 | 33 | :type version: tuple of integers | ||
912 | 34 | :param just_test: if True, only run unit tests | ||
913 | 35 | """ | ||
914 | 12 | arguments = ['-c', conf] | 36 | arguments = ['-c', conf] |
915 | 13 | 37 | ||
916 | 14 | if just_test: | 38 | if just_test: |
917 | @@ -19,6 +43,16 @@ | |||
918 | 19 | if version >= (7, 0): | 43 | if version >= (7, 0): |
919 | 20 | arguments.append('--test-enable') | 44 | arguments.append('--test-enable') |
920 | 21 | 45 | ||
921 | 46 | if '--install-all' in sys.argv: | ||
922 | 47 | sys.argv.remove('--install-all') | ||
923 | 48 | from openerp.tools import config | ||
924 | 49 | # Maybe we should preparse config in all cases and therefore avoid | ||
925 | 50 | # adding the '-c' on the fly ? | ||
926 | 51 | # Still, cautious about pre-6.1 versions | ||
927 | 52 | config.parse_config(['-c', conf]) | ||
928 | 53 | from openerp.modules import get_modules | ||
929 | 54 | arguments.extend(('-i', ','.join(get_modules()))) | ||
930 | 55 | |||
931 | 22 | insert_args(arguments) | 56 | insert_args(arguments) |
932 | 23 | 57 | ||
933 | 24 | if version == (5, 0): | 58 | if version == (5, 0): |
934 | @@ -28,4 +62,12 @@ | |||
935 | 28 | glob = globals() | 62 | glob = globals() |
936 | 29 | glob['__name__'] = '__main__' | 63 | glob['__name__'] = '__main__' |
937 | 30 | glob['__file__'] = starter | 64 | glob['__file__'] = starter |
939 | 31 | execfile(starter, globals()) | 65 | try: |
940 | 66 | execfile(starter, globals()) | ||
941 | 67 | except SystemExit as exc: | ||
942 | 68 | if version == (5, 0): | ||
943 | 69 | # Without Agent.quit() the Timer threads may go on forever | ||
944 | 70 | # and the script will never stop | ||
945 | 71 | import netsvc | ||
946 | 72 | netsvc.Agent.quit() | ||
947 | 73 | return exc.code | ||
948 | 32 | 74 | ||
949 | === renamed file 'anybox/recipe/openerp/test_openerp.py' => 'anybox/recipe/openerp/runtime/test_openerp.py' | |||
950 | === added directory 'anybox/recipe/openerp/runtime/tests' | |||
951 | === added file 'anybox/recipe/openerp/runtime/tests/__init__.py' | |||
952 | --- anybox/recipe/openerp/runtime/tests/__init__.py 1970-01-01 00:00:00 +0000 | |||
953 | +++ anybox/recipe/openerp/runtime/tests/__init__.py 2014-02-06 07:42:46 +0000 | |||
954 | @@ -0,0 +1,1 @@ | |||
955 | 1 | # python package | ||
956 | 0 | 2 | ||
957 | === renamed file 'anybox/recipe/openerp/tests/test_startup.py' => 'anybox/recipe/openerp/runtime/tests/test_import_registry.py' | |||
958 | --- anybox/recipe/openerp/tests/test_startup.py 2013-06-15 11:33:47 +0000 | |||
959 | +++ anybox/recipe/openerp/runtime/tests/test_import_registry.py 2014-02-06 07:42:46 +0000 | |||
960 | @@ -1,5 +1,5 @@ | |||
961 | 1 | from unittest import TestCase | 1 | from unittest import TestCase |
963 | 2 | from ..startup import already_imported, clear_import_registry | 2 | from .. import already_imported, clear_import_registry |
964 | 3 | 3 | ||
965 | 4 | 4 | ||
966 | 5 | class TestImportRegistry(TestCase): | 5 | class TestImportRegistry(TestCase): |
967 | 6 | 6 | ||
968 | === added file 'anybox/recipe/openerp/runtime/upgrade.py' | |||
969 | --- anybox/recipe/openerp/runtime/upgrade.py 1970-01-01 00:00:00 +0000 | |||
970 | +++ anybox/recipe/openerp/runtime/upgrade.py 2014-02-06 07:42:46 +0000 | |||
971 | @@ -0,0 +1,153 @@ | |||
972 | 1 | """Uniform encapsulation of buildout-local upgrade script. | ||
973 | 2 | |||
974 | 3 | The idea is to provide a common set of options, so that upgrade scripts all | ||
975 | 4 | have the same interface, and project maintainers can focus on the decision | ||
976 | 5 | taking logic. | ||
977 | 6 | """ | ||
978 | 7 | import os | ||
979 | 8 | import sys | ||
980 | 9 | import imp | ||
981 | 10 | import logging | ||
982 | 11 | from argparse import ArgumentParser | ||
983 | 12 | from argparse import ArgumentDefaultsHelpFormatter | ||
984 | 13 | from argparse import SUPPRESS | ||
985 | 14 | from datetime import datetime | ||
986 | 15 | from math import ceil | ||
987 | 16 | |||
988 | 17 | from .session import Session | ||
989 | 18 | |||
990 | 19 | DEFAULT_LOG_FILE = 'upgrade.log' | ||
991 | 20 | |||
992 | 21 | |||
993 | 22 | def upgrade(upgrade_script, upgrade_callable, conf, buildout_dir): | ||
994 | 23 | """Run the upgrade from a source file. | ||
995 | 24 | |||
996 | 25 | All arguments are set in the standalone script produced by buildout through | ||
997 | 26 | entry point options. | ||
998 | 27 | |||
999 | 28 | * ``upgrade_script``: absolute path to the upgrade script python source. | ||
1000 | 29 | * ``upgrade_callable``: name of the callable in source file actually | ||
1001 | 30 | running the script. | ||
1002 | 31 | |||
1003 | 32 | It must accept the two following positional arguments, in that order: | ||
1004 | 33 | |||
1005 | 34 | - a :class:`.Session` instance (as in standard "OpenERP scripts") | ||
1006 | 35 | - a logger (standard object from the :mod:`logging` module) | ||
1007 | 36 | |||
1008 | 37 | and may return a non zero status code to indicate an error. | ||
1009 | 38 | Both ``None`` and 0 are interpreted as success. | ||
1010 | 39 | |||
1011 | 40 | * ``conf``: path to the OpenERP configuration file (managed by the recipe) | ||
1012 | 41 | * ``buildout_dir``: directory of the buildout | ||
1013 | 42 | """ | ||
1014 | 43 | |||
1015 | 44 | parser = ArgumentParser(formatter_class=ArgumentDefaultsHelpFormatter, | ||
1016 | 45 | epilog="") | ||
1017 | 46 | parser.add_argument('--log-file', default=DEFAULT_LOG_FILE, | ||
1018 | 47 | help="File to log sub-operations to, relative to the " | ||
1019 | 48 | "current working directory, supports homedir " | ||
1020 | 49 | "expansion ('~' on POSIX systems).") | ||
1021 | 50 | parser.add_argument('--log-level', default='info', | ||
1022 | 51 | help="Main OpenERP logging level. Does not affect the " | ||
1023 | 52 | "logging from the main upgrade script itself.") | ||
1024 | 53 | parser.add_argument('--console-log-level', default='info', | ||
1025 | 54 | help="Level for the upgrade process console " | ||
1026 | 55 | "logging. This is for the main upgrade script itself " | ||
1027 | 56 | "meaning that usually only major steps should be " | ||
1028 | 57 | "logged ") | ||
1029 | 58 | parser.add_argument('-q', '--quiet', action='store_true', | ||
1030 | 59 | help="Suppress console output from the main upgrade " | ||
1031 | 60 | "script (lower level stages can still write)") | ||
1032 | 61 | parser.add_argument('-d', '--db-name', default=SUPPRESS, | ||
1033 | 62 | help="Database name. If ommitted, the general default " | ||
1034 | 63 | "values from OpenERP config file or libpq will apply.") | ||
1035 | 64 | parser.add_argument('--init-load-demo-data', action='store_true', | ||
1036 | 65 | help="Demo data will be loaded with module " | ||
1037 | 66 | "installations if and only if " | ||
1038 | 67 | "this modifier is specified") | ||
1039 | 68 | |||
1040 | 69 | arguments = parser.parse_args() # 'args' would shadow the one of pdb | ||
1041 | 70 | log_path = os.path.abspath(os.path.expanduser(arguments.log_file)) | ||
1042 | 71 | log_level = arguments.log_level | ||
1043 | 72 | console_level = arguments.console_log_level.upper() | ||
1044 | 73 | quiet = arguments.quiet | ||
1045 | 74 | |||
1046 | 75 | try: | ||
1047 | 76 | log_file = open(log_path, 'a') | ||
1048 | 77 | except IOError: | ||
1049 | 78 | sys.stderr.write("Cannot open %r for write" % log_path + os.linesep) | ||
1050 | 79 | sys.exit(-1) | ||
1051 | 80 | |||
1052 | 81 | session = Session(conf, buildout_dir) | ||
1053 | 82 | |||
1054 | 83 | from openerp.tools import config | ||
1055 | 84 | config['logfile'] = log_path | ||
1056 | 85 | config['log-level'] = log_level | ||
1057 | 86 | |||
1058 | 87 | start_time = datetime.utcnow() | ||
1059 | 88 | if not quiet: | ||
1060 | 89 | print("Starting upgrade, logging details to %s at level %s, " | ||
1061 | 90 | "and major steps to console at level %s" % ( | ||
1062 | 91 | log_path, log_level.upper(), console_level.upper())) | ||
1063 | 92 | print('') | ||
1064 | 93 | |||
1065 | 94 | logger = logging.getLogger('openerp.upgrade') | ||
1066 | 95 | console_handler = logging.StreamHandler() | ||
1067 | 96 | console_handler.setLevel(getattr(logging, console_level)) | ||
1068 | 97 | console_handler.setFormatter(logging.Formatter( | ||
1069 | 98 | "%(asctime)s %(levelname)s %(message)s")) | ||
1070 | 99 | |||
1071 | 100 | if not arguments.quiet: | ||
1072 | 101 | logger.addHandler(console_handler) | ||
1073 | 102 | |||
1074 | 103 | db_name = getattr(arguments, 'db_name', None) | ||
1075 | 104 | logger.info("Opening database %r", db_name) | ||
1076 | 105 | session.open(db=db_name, with_demo=bool(arguments.init_load_demo_data)) | ||
1077 | 106 | # actual value after all defaultings have been done | ||
1078 | 107 | db_name = session.cr.dbname | ||
1079 | 108 | |||
1080 | 109 | if session.is_initialization: | ||
1081 | 110 | logger.info("Database %r base initialization done. Proceeding further", | ||
1082 | 111 | db_name) | ||
1083 | 112 | else: | ||
1084 | 113 | logger.info("Database %r loaded. Actual upgrade begins.", db_name) | ||
1085 | 114 | |||
1086 | 115 | pkg_version = session.package_version | ||
1087 | 116 | if pkg_version is None: | ||
1088 | 117 | logger.warn("Expected package version file %r does not exist. " | ||
1089 | 118 | "version won't be set in database at the end of upgrade. " | ||
1090 | 119 | "Consider including such a version file in your project " | ||
1091 | 120 | "*before* version dependent logic is actually needed.", | ||
1092 | 121 | session.version_file_path) | ||
1093 | 122 | else: | ||
1094 | 123 | logger.info("Read package version: %s from %s", pkg_version, | ||
1095 | 124 | session.version_file_path) | ||
1096 | 125 | |||
1097 | 126 | db_version = session.db_version | ||
1098 | 127 | if db_version is None: | ||
1099 | 128 | if not session.is_initialization: | ||
1100 | 129 | logger.warn("No version currently set in database (the present " | ||
1101 | 130 | "upgrade script has never been run). Consider setting " | ||
1102 | 131 | "database version even for fresh instances, to " | ||
1103 | 132 | "eliminate any guesswork in the upgrade scripts.") | ||
1104 | 133 | else: | ||
1105 | 134 | logger.info("Database latest upgrade version : %s", db_version) | ||
1106 | 135 | |||
1107 | 136 | upgrade_module = imp.load_source('anybox.recipe.openerp.upgrade_openerp', | ||
1108 | 137 | upgrade_script) | ||
1109 | 138 | statuscode = getattr(upgrade_module, upgrade_callable)(session, logger) | ||
1110 | 139 | if statuscode is None or statuscode == 0: | ||
1111 | 140 | if pkg_version is not None: | ||
1112 | 141 | logger.info("setting version %s in database" % pkg_version) | ||
1113 | 142 | session.db_version = pkg_version | ||
1114 | 143 | session.cr.commit() | ||
1115 | 144 | |||
1116 | 145 | logger.info("%s successful. Total time: %d seconds." % ( | ||
1117 | 146 | "Initialization" if session.is_initialization else "Upgrade", | ||
1118 | 147 | ceil((datetime.utcnow() - start_time).total_seconds()) | ||
1119 | 148 | )) | ||
1120 | 149 | else: | ||
1121 | 150 | logger.error("Please check logs at %s" % log_path) | ||
1122 | 151 | |||
1123 | 152 | log_file.close() | ||
1124 | 153 | sys.exit(statuscode) | ||
1125 | 0 | 154 | ||
1126 | === modified file 'anybox/recipe/openerp/server.py' | |||
1127 | --- anybox/recipe/openerp/server.py 2013-09-08 17:19:27 +0000 | |||
1128 | +++ anybox/recipe/openerp/server.py 2014-02-06 07:42:46 +0000 | |||
1129 | @@ -2,6 +2,7 @@ | |||
1130 | 2 | import os | 2 | import os |
1131 | 3 | from os.path import join | 3 | from os.path import join |
1132 | 4 | import sys | 4 | import sys |
1133 | 5 | import shutil | ||
1134 | 5 | import logging | 6 | import logging |
1135 | 6 | import subprocess | 7 | import subprocess |
1136 | 7 | import zc.buildout | 8 | import zc.buildout |
1137 | @@ -46,13 +47,17 @@ | |||
1138 | 46 | soft_requirements = ('openerp-command',) | 47 | soft_requirements = ('openerp-command',) |
1139 | 47 | with_openerp_command = False | 48 | with_openerp_command = False |
1140 | 48 | with_gunicorn = False | 49 | with_gunicorn = False |
1141 | 50 | with_upgrade = True | ||
1142 | 49 | ws = None | 51 | ws = None |
1143 | 52 | template_upgrade_script = os.path.join(os.path.dirname(__file__), | ||
1144 | 53 | 'upgrade.py.tmpl') | ||
1145 | 50 | 54 | ||
1146 | 51 | def __init__(self, *a, **kw): | 55 | def __init__(self, *a, **kw): |
1147 | 52 | super(ServerRecipe, self).__init__(*a, **kw) | 56 | super(ServerRecipe, self).__init__(*a, **kw) |
1148 | 53 | opt = self.options | 57 | opt = self.options |
1149 | 54 | self.with_devtools = ( | 58 | self.with_devtools = ( |
1150 | 55 | opt.get('with_devtools', 'false').lower() == 'true') | 59 | opt.get('with_devtools', 'false').lower() == 'true') |
1151 | 60 | self.with_upgrade = self.options.get('upgrade_script') != '' | ||
1152 | 56 | # discarding, because we have a special behaviour with custom | 61 | # discarding, because we have a special behaviour with custom |
1153 | 57 | # interpreters | 62 | # interpreters |
1154 | 58 | opt.pop('interpreter', None) | 63 | opt.pop('interpreter', None) |
1155 | @@ -186,6 +191,7 @@ | |||
1156 | 186 | timeout = %(timeout)s | 191 | timeout = %(timeout)s |
1157 | 187 | max_requests = %(max_requests)s | 192 | max_requests = %(max_requests)s |
1158 | 188 | 193 | ||
1159 | 194 | openerp.multi_process = True # needed even with only one worker | ||
1160 | 189 | openerp.conf.server_wide_modules = ['web'] | 195 | openerp.conf.server_wide_modules = ['web'] |
1161 | 190 | conf = openerp.tools.config | 196 | conf = openerp.tools.config |
1162 | 191 | """ % gunicorn_options | 197 | """ % gunicorn_options |
1163 | @@ -339,6 +345,29 @@ | |||
1164 | 339 | self.major_version), | 345 | self.major_version), |
1165 | 340 | ) | 346 | ) |
1166 | 341 | 347 | ||
1167 | 348 | def _register_upgrade_script(self, qualified_name): | ||
1168 | 349 | desc = self._get_or_create_script('openerp_upgrader', | ||
1169 | 350 | name=qualified_name)[1] | ||
1170 | 351 | script_opt = self.options.get('upgrade_script', 'upgrade.py run') | ||
1171 | 352 | script = script_opt.split() | ||
1172 | 353 | if len(script) != 2: | ||
1173 | 354 | # TODO add console script entry point support | ||
1174 | 355 | raise zc.buildout.UserError( | ||
1175 | 356 | ("upgrade_script option must take the form " | ||
1176 | 357 | "SOURCE_FILE CALLABLE (got '%r')" % script)) | ||
1177 | 358 | script_source_path = self.make_absolute(script[0]) | ||
1178 | 359 | desc.update( | ||
1179 | 360 | entry='openerp_upgrader', | ||
1180 | 361 | arguments='%r, %r, %r, %r' % ( | ||
1181 | 362 | script_source_path, script[1], | ||
1182 | 363 | self.config_path, self.buildout_dir), | ||
1183 | 364 | ) | ||
1184 | 365 | |||
1185 | 366 | if not os.path.exists(script_source_path): | ||
1186 | 367 | logger.warning("Ugrade script source %s does not exist." | ||
1187 | 368 | "Initializing it for you", script_source_path) | ||
1188 | 369 | shutil.copy(self.template_upgrade_script, script_source_path) | ||
1189 | 370 | |||
1190 | 342 | def _register_gunicorn_startup_script(self, qualified_name): | 371 | def _register_gunicorn_startup_script(self, qualified_name): |
1191 | 343 | """Register a gunicorn foreground start script for installation. | 372 | """Register a gunicorn foreground start script for installation. |
1192 | 344 | 373 | ||
1193 | @@ -448,8 +477,10 @@ | |||
1194 | 448 | 477 | ||
1195 | 449 | initialization = os.linesep.join(( | 478 | initialization = os.linesep.join(( |
1196 | 450 | "", | 479 | "", |
1199 | 451 | "from anybox.recipe.openerp.startup import Session", | 480 | "from anybox.recipe.openerp.runtime.session import Session", |
1200 | 452 | "session = Session(%s)" % self._relativitize(self.config_path), | 481 | "session = Session(%s, %r)" % ( |
1201 | 482 | self._relativitize(self.config_path), | ||
1202 | 483 | self.buildout_dir), | ||
1203 | 453 | "if len(sys.argv) <= 1:", | 484 | "if len(sys.argv) <= 1:", |
1204 | 454 | " print('To start the OpenERP working session, just do:')", | 485 | " print('To start the OpenERP working session, just do:')", |
1205 | 455 | " print(' session.open(db=DATABASE_NAME)')", | 486 | " print(' session.open(db=DATABASE_NAME)')", |
1206 | @@ -488,8 +519,9 @@ | |||
1207 | 488 | 519 | ||
1208 | 489 | common_init = os.linesep.join(( | 520 | common_init = os.linesep.join(( |
1209 | 490 | "", | 521 | "", |
1212 | 491 | "from anybox.recipe.openerp.startup import Session", | 522 | "from anybox.recipe.openerp.runtime.session import Session", |
1213 | 492 | "session = Session(%r)" % self.config_path, | 523 | "session = Session(%r, %r)" % (self.config_path, |
1214 | 524 | self.buildout_dir), | ||
1215 | 493 | )) | 525 | )) |
1216 | 494 | 526 | ||
1217 | 495 | for script_name, desc in self.openerp_scripts.items(): | 527 | for script_name, desc in self.openerp_scripts.items(): |
1218 | @@ -518,9 +550,15 @@ | |||
1219 | 518 | 550 | ||
1220 | 519 | # provide additional needed entry points for main start/test scripts | 551 | # provide additional needed entry points for main start/test scripts |
1221 | 520 | self.eggs_reqs.extend(( | 552 | self.eggs_reqs.extend(( |
1225 | 521 | ('openerp_starter', 'anybox.recipe.openerp.start_openerp', 'main'), | 553 | ('openerp_starter', |
1226 | 522 | ('openerp_cron_worker', 'anybox.recipe.openerp.start_openerp', | 554 | 'anybox.recipe.openerp.runtime.start_openerp', |
1227 | 523 | 'main'), | 555 | 'main'), |
1228 | 556 | ('openerp_cron_worker', | ||
1229 | 557 | 'anybox.recipe.openerp.runtime.start_openerp', | ||
1230 | 558 | 'main'), | ||
1231 | 559 | ('openerp_upgrader', | ||
1232 | 560 | 'anybox.recipe.openerp.runtime.upgrade', | ||
1233 | 561 | 'upgrade'), | ||
1234 | 524 | )) | 562 | )) |
1235 | 525 | 563 | ||
1236 | 526 | if self.major_version >= (8, 0): | 564 | if self.major_version >= (8, 0): |
1237 | @@ -551,6 +589,11 @@ | |||
1238 | 551 | 'cron_worker_%s' % self.name) | 589 | 'cron_worker_%s' % self.name) |
1239 | 552 | self._register_cron_worker_startup_script(qualified_name) | 590 | self._register_cron_worker_startup_script(qualified_name) |
1240 | 553 | 591 | ||
1241 | 592 | if self.with_upgrade: | ||
1242 | 593 | qualified_name = self.options.get('upgrade_script_name', | ||
1243 | 594 | 'upgrade_%s' % self.name) | ||
1244 | 595 | self._register_upgrade_script(qualified_name) | ||
1245 | 596 | |||
1246 | 554 | self._install_openerp_scripts() | 597 | self._install_openerp_scripts() |
1247 | 555 | 598 | ||
1248 | 556 | def _60_fix_root_path(self): | 599 | def _60_fix_root_path(self): |
1249 | 557 | 600 | ||
1250 | === modified file 'anybox/recipe/openerp/tests/test_server.py' | |||
1251 | --- anybox/recipe/openerp/tests/test_server.py 2013-08-25 06:31:14 +0000 | |||
1252 | +++ anybox/recipe/openerp/tests/test_server.py 2014-02-06 07:42:46 +0000 | |||
1253 | @@ -251,8 +251,8 @@ | |||
1254 | 251 | self.recipe.retrieve_addons() | 251 | self.recipe.retrieve_addons() |
1255 | 252 | paths = self.recipe.addons_paths | 252 | paths = self.recipe.addons_paths |
1256 | 253 | self.recipe.finalize_addons_paths(check_existence=False) | 253 | self.recipe.finalize_addons_paths(check_existence=False) |
1259 | 254 | self.assertEquals(paths, [addons_dir, | 254 | self.assertEquals(paths, [os.path.join(oerp_dir, 'openerp', 'addons'), |
1260 | 255 | os.path.join(oerp_dir, 'openerp', 'addons')]) | 255 | addons_dir]) |
1261 | 256 | 256 | ||
1262 | 257 | def test_retrieve_fixup_addons_local_60_check_ok(self): | 257 | def test_retrieve_fixup_addons_local_60_check_ok(self): |
1263 | 258 | oerp_dir = os.path.join(TEST_DIR, 'oerp60') | 258 | oerp_dir = os.path.join(TEST_DIR, 'oerp60') |
1264 | @@ -268,7 +268,7 @@ | |||
1265 | 268 | os.mkdir(addons_dir) | 268 | os.mkdir(addons_dir) |
1266 | 269 | self.recipe.finalize_addons_paths() | 269 | self.recipe.finalize_addons_paths() |
1267 | 270 | paths = self.recipe.addons_paths | 270 | paths = self.recipe.addons_paths |
1269 | 271 | self.assertEqual(paths, [addons_dir, root_dir]) | 271 | self.assertEqual(paths, [root_dir, addons_dir]) |
1270 | 272 | self.assertEqual(self.recipe.options['options.root_path'], | 272 | self.assertEqual(self.recipe.options['options.root_path'], |
1271 | 273 | os.path.join(oerp_dir, 'bin')) | 273 | os.path.join(oerp_dir, 'bin')) |
1272 | 274 | 274 | ||
1273 | 275 | 275 | ||
1274 | === added file 'anybox/recipe/openerp/tests/test_utils.py' | |||
1275 | --- anybox/recipe/openerp/tests/test_utils.py 1970-01-01 00:00:00 +0000 | |||
1276 | +++ anybox/recipe/openerp/tests/test_utils.py 2014-02-06 07:42:46 +0000 | |||
1277 | @@ -0,0 +1,25 @@ | |||
1278 | 1 | import unittest | ||
1279 | 2 | import tempfile | ||
1280 | 3 | import shutil | ||
1281 | 4 | import os | ||
1282 | 5 | |||
1283 | 6 | from ..utils import working_directory_keeper | ||
1284 | 7 | |||
1285 | 8 | |||
1286 | 9 | class WorkingDirectoryTestCase(unittest.TestCase): | ||
1287 | 10 | |||
1288 | 11 | def setUp(self): | ||
1289 | 12 | self.dirpath = tempfile.mkdtemp() | ||
1290 | 13 | |||
1291 | 14 | def tearDown(self): | ||
1292 | 15 | shutil.rmtree(self.dirpath) | ||
1293 | 16 | |||
1294 | 17 | def test_ctx_manager(self): | ||
1295 | 18 | # warning: if this fails, then many other tests can be | ||
1296 | 19 | # affected, because many don't like being in / | ||
1297 | 20 | current = os.getcwd() | ||
1298 | 21 | with working_directory_keeper: | ||
1299 | 22 | os.chdir(self.dirpath) | ||
1300 | 23 | self.assertNotEqual(os.getcwd(), current) | ||
1301 | 24 | |||
1302 | 25 | self.assertEqual(os.getcwd(), current) | ||
1303 | 0 | 26 | ||
1304 | === added file 'anybox/recipe/openerp/upgrade.py.tmpl' | |||
1305 | --- anybox/recipe/openerp/upgrade.py.tmpl 1970-01-01 00:00:00 +0000 | |||
1306 | +++ anybox/recipe/openerp/upgrade.py.tmpl 2014-02-06 07:42:46 +0000 | |||
1307 | @@ -0,0 +1,19 @@ | |||
1308 | 1 | # -*- python -*- | ||
1309 | 2 | """This is a template upgrade script. | ||
1310 | 3 | |||
1311 | 4 | The purpose is both to cover the most common use-case (updating all modules) | ||
1312 | 5 | and to provide an example of how this works. | ||
1313 | 6 | """ | ||
1314 | 7 | |||
1315 | 8 | |||
1316 | 9 | def run(session, logger): | ||
1317 | 10 | """Update all modules.""" | ||
1318 | 11 | if session.is_initialization: | ||
1319 | 12 | logger.warn("Usage of upgrade script for initialization detected. " | ||
1320 | 13 | "You should consider customizing the present upgrade " | ||
1321 | 14 | "script to add modules install commands. The present " | ||
1322 | 15 | "script is at : %s (byte-compiled form)", | ||
1323 | 16 | __file__) | ||
1324 | 17 | return | ||
1325 | 18 | logger.info("Default upgrade procedure : updating all modules.") | ||
1326 | 19 | session.update_modules(['all']) | ||
1327 | 0 | 20 | ||
1328 | === modified file 'anybox/recipe/openerp/utils.py' | |||
1329 | --- anybox/recipe/openerp/utils.py 2013-08-27 09:29:47 +0000 | |||
1330 | +++ anybox/recipe/openerp/utils.py 2014-02-06 07:42:46 +0000 | |||
1331 | @@ -7,6 +7,9 @@ | |||
1332 | 7 | logger = logging.getLogger(__name__) | 7 | logger = logging.getLogger(__name__) |
1333 | 8 | 8 | ||
1334 | 9 | 9 | ||
1335 | 10 | MAJOR_VERSION_RE = re.compile(r'(\d+)[.](\d*)(\w*)') | ||
1336 | 11 | |||
1337 | 12 | |||
1338 | 10 | class WorkingDirectoryKeeper(object): | 13 | class WorkingDirectoryKeeper(object): |
1339 | 11 | """A context manager to get back the working directory as it was before. | 14 | """A context manager to get back the working directory as it was before. |
1340 | 12 | 15 | ||
1341 | @@ -43,11 +46,6 @@ | |||
1342 | 43 | yield f | 46 | yield f |
1343 | 44 | 47 | ||
1344 | 45 | 48 | ||
1345 | 46 | NIGHTLY_VERSION_RE = re.compile(r'(\d+)[.](\d+)-(\d+-\d+)$') | ||
1346 | 47 | |||
1347 | 48 | MAJOR_VERSION_RE = re.compile(r'(\d+)[.](\d+)') | ||
1348 | 49 | |||
1349 | 50 | |||
1350 | 51 | def major_version(version_string): | 49 | def major_version(version_string): |
1351 | 52 | """The least common denominator of OpenERP versions : two numbers. | 50 | """The least common denominator of OpenERP versions : two numbers. |
1352 | 53 | 51 | ||
1353 | @@ -55,14 +53,43 @@ | |||
1354 | 55 | releases, bzr versions etc. It's almost impossible to compare them without | 53 | releases, bzr versions etc. It's almost impossible to compare them without |
1355 | 56 | an a priori knowledge of release dates and revisions. | 54 | an a priori knowledge of release dates and revisions. |
1356 | 57 | 55 | ||
1357 | 56 | Here are some examples:: | ||
1358 | 57 | |||
1359 | 58 | >>> major_version('1.2.3-foo.bar') | ||
1360 | 59 | (1, 2) | ||
1361 | 60 | >>> major_version('6.1-20121003-233130') | ||
1362 | 61 | (6, 1) | ||
1363 | 62 | >>> major_version('7.0alpha') | ||
1364 | 63 | (7, 0) | ||
1365 | 64 | |||
1366 | 58 | Beware, the packaging script does funny things, such as labeling current | 65 | Beware, the packaging script does funny things, such as labeling current |
1367 | 59 | nightlies as 6.2-date-time whereas version_info is (7, 0, 0, ALPHA) | 66 | nightlies as 6.2-date-time whereas version_info is (7, 0, 0, ALPHA) |
1368 | 60 | We can in recipe code check for >= (6, 2), that's not a big issue. | 67 | We can in recipe code check for >= (6, 2), that's not a big issue. |
1369 | 68 | |||
1370 | 69 | Regarding OpenERP saas releases (e.g. 7.saas~1) that are short-lived stable | ||
1371 | 70 | versions between two "X.0" LTS releases, the second version number does not | ||
1372 | 71 | contain a numeric value. The value X.5 will be returned (e.g. 7.5):: | ||
1373 | 72 | |||
1374 | 73 | >>> major_version('7.saas~1') | ||
1375 | 74 | (7, 5) | ||
1376 | 75 | |||
1377 | 61 | """ | 76 | """ |
1378 | 62 | 77 | ||
1379 | 63 | m = MAJOR_VERSION_RE.match(version_string) | 78 | m = MAJOR_VERSION_RE.match(version_string) |
1382 | 64 | if m is not None: | 79 | |
1383 | 65 | return tuple(int(m.group(i)) for i in (1, 2)) | 80 | if m is None: |
1384 | 81 | raise ValueError("Unparseable version string: %r" % version_string) | ||
1385 | 82 | |||
1386 | 83 | major = int(m.group(1)) | ||
1387 | 84 | minor = m.group(2) | ||
1388 | 85 | if not minor and m.group(3).startswith('saas'): | ||
1389 | 86 | return major, 5 | ||
1390 | 87 | |||
1391 | 88 | try: | ||
1392 | 89 | return major, int(minor) | ||
1393 | 90 | except TypeError: | ||
1394 | 91 | raise ValueError( | ||
1395 | 92 | "Unrecognized second version segment in %r" % version_string) | ||
1396 | 66 | 93 | ||
1397 | 67 | 94 | ||
1398 | 68 | def mkdirp(path): | 95 | def mkdirp(path): |
1399 | 69 | 96 | ||
1400 | === modified file 'anybox/recipe/openerp/vcs/bzr.py' | |||
1401 | --- anybox/recipe/openerp/vcs/bzr.py 2013-09-06 12:14:37 +0000 | |||
1402 | +++ anybox/recipe/openerp/vcs/bzr.py 2014-02-06 07:42:46 +0000 | |||
1403 | @@ -213,7 +213,13 @@ | |||
1404 | 213 | 213 | ||
1405 | 214 | self.update_conf() | 214 | self.update_conf() |
1406 | 215 | 215 | ||
1407 | 216 | init_opt = self.options.get('bzr-init') | ||
1408 | 216 | if self.is_fixed_revision(revision): | 217 | if self.is_fixed_revision(revision): |
1409 | 218 | if (offline and init_opt == 'lightweight-checkout'): | ||
1410 | 219 | logger.warning("Offline mode, no update for lightweight " | ||
1411 | 220 | "checkout at %s on revision %r", | ||
1412 | 221 | self.target_dir, revision) | ||
1413 | 222 | return | ||
1414 | 217 | try: | 223 | try: |
1415 | 218 | self._update(revision) | 224 | self._update(revision) |
1416 | 219 | return | 225 | return |
1417 | @@ -225,8 +231,9 @@ | |||
1418 | 225 | logger.info("Offline mode, no pull for revision %r", revision) | 231 | logger.info("Offline mode, no pull for revision %r", revision) |
1419 | 226 | else: | 232 | else: |
1420 | 227 | self._pull() | 233 | self._pull() |
1423 | 228 | if not (offline and | 234 | |
1424 | 229 | self.options.get('bzr-init') == 'stacked-branch'): | 235 | if not (offline and init_opt in ('stacked-branch', |
1425 | 236 | 'lightweight-checkout')): | ||
1426 | 230 | self._update(revision) | 237 | self._update(revision) |
1427 | 231 | 238 | ||
1428 | 232 | def _branch(self, revision): | 239 | def _branch(self, revision): |
1429 | 233 | 240 | ||
1430 | === modified file 'anybox/recipe/openerp/vcs/git.py' | |||
1431 | --- anybox/recipe/openerp/vcs/git.py 2013-09-06 16:21:36 +0000 | |||
1432 | +++ anybox/recipe/openerp/vcs/git.py 2014-02-06 07:42:46 +0000 | |||
1433 | @@ -82,7 +82,8 @@ | |||
1434 | 82 | 82 | ||
1435 | 83 | def archive(self, target_path): | 83 | def archive(self, target_path): |
1436 | 84 | revision = self.parents()[0] | 84 | revision = self.parents()[0] |
1438 | 85 | os.makedirs(target_path) | 85 | if not os.path.exists(target_path): |
1439 | 86 | os.makedirs(target_path) | ||
1440 | 86 | with working_directory_keeper: | 87 | with working_directory_keeper: |
1441 | 87 | os.chdir(self.target_dir) | 88 | os.chdir(self.target_dir) |
1442 | 88 | target_tar = tempfile.NamedTemporaryFile( | 89 | target_tar = tempfile.NamedTemporaryFile( |
1443 | 89 | 90 | ||
1444 | === modified file 'anybox/recipe/openerp/vcs/tests/test_bzr.py' | |||
1445 | --- anybox/recipe/openerp/vcs/tests/test_bzr.py 2013-09-06 12:14:37 +0000 | |||
1446 | +++ anybox/recipe/openerp/vcs/tests/test_bzr.py 2014-02-06 07:42:46 +0000 | |||
1447 | @@ -332,18 +332,20 @@ | |||
1448 | 332 | 332 | ||
1449 | 333 | class BzrOfflineTestCase(BzrBaseTestCase): | 333 | class BzrOfflineTestCase(BzrBaseTestCase): |
1450 | 334 | 334 | ||
1452 | 335 | def make_local_branch(self, path, initial_rev): | 335 | def make_local_branch(self, path, initial_rev, options=None): |
1453 | 336 | """Make a local branch of the source at initial_rev and forbid pulls. | 336 | """Make a local branch of the source at initial_rev and forbid pulls. |
1454 | 337 | """ | 337 | """ |
1455 | 338 | if options is None: | ||
1456 | 339 | options = {} | ||
1457 | 338 | target_dir = os.path.join(self.dst_dir, path) | 340 | target_dir = os.path.join(self.dst_dir, path) |
1458 | 339 | # initial branching (non offline | 341 | # initial branching (non offline |
1459 | 340 | BzrBranch(target_dir, self.src_repo)(initial_rev) | 342 | BzrBranch(target_dir, self.src_repo)(initial_rev) |
1460 | 341 | 343 | ||
1461 | 342 | # crippled offline branch | 344 | # crippled offline branch |
1463 | 343 | branch = BzrBranch(target_dir, self.src_repo, offline=True) | 345 | branch = BzrBranch(target_dir, self.src_repo, offline=True, **options) |
1464 | 344 | 346 | ||
1465 | 345 | def _pull(): | 347 | def _pull(): |
1467 | 346 | raise UpdateError("Should not pull !") | 348 | self.fail("Should not pull !") |
1468 | 347 | 349 | ||
1469 | 348 | branch._pull = _pull | 350 | branch._pull = _pull |
1470 | 349 | return branch | 351 | return branch |
1471 | @@ -373,3 +375,31 @@ | |||
1472 | 373 | revid = branch.get_revid('1') | 375 | revid = branch.get_revid('1') |
1473 | 374 | branch('revid:' + revid) | 376 | branch('revid:' + revid) |
1474 | 375 | self.assertRevision1(branch) | 377 | self.assertRevision1(branch) |
1475 | 378 | |||
1476 | 379 | def test_lightweight_checkout_noupdate(self): | ||
1477 | 380 | """[offline mode] lightweight checkouts shall not be updated.""" | ||
1478 | 381 | branch = self.make_local_branch( | ||
1479 | 382 | "clone to update", '1', | ||
1480 | 383 | options={'bzr-init': 'lightweight-checkout'}) | ||
1481 | 384 | |||
1482 | 385 | def _update(*a, **kw): | ||
1483 | 386 | self.fail("Should not update !") | ||
1484 | 387 | |||
1485 | 388 | branch._update = _update | ||
1486 | 389 | |||
1487 | 390 | branch('last:1') | ||
1488 | 391 | self.assertRevision1(branch) | ||
1489 | 392 | |||
1490 | 393 | def test_lightweight_checkout_noupdate_fixed_rev(self): | ||
1491 | 394 | """[offline mode] lightweight checkouts shall not be updated.""" | ||
1492 | 395 | branch = self.make_local_branch( | ||
1493 | 396 | "clone to update", 'last:1', | ||
1494 | 397 | options={'bzr-init': 'lightweight-checkout'}) | ||
1495 | 398 | |||
1496 | 399 | def _update(*a, **kw): | ||
1497 | 400 | self.fail("Should not update !") | ||
1498 | 401 | |||
1499 | 402 | branch._update = _update | ||
1500 | 403 | |||
1501 | 404 | branch('1') | ||
1502 | 405 | self.assertRevision2(branch) | ||
1503 | 376 | 406 | ||
1504 | === modified file 'anybox/recipe/openerp/vcs/tests/test_git.py' | |||
1505 | --- anybox/recipe/openerp/vcs/tests/test_git.py 2013-09-06 16:21:36 +0000 | |||
1506 | +++ anybox/recipe/openerp/vcs/tests/test_git.py 2014-02-06 07:42:46 +0000 | |||
1507 | @@ -120,6 +120,9 @@ | |||
1508 | 120 | repo(new_sha) | 120 | repo(new_sha) |
1509 | 121 | self.assertEqual(repo.parents(), [new_sha]) | 121 | self.assertEqual(repo.parents(), [new_sha]) |
1510 | 122 | 122 | ||
1511 | 123 | # see launchpad #1215873 | ||
1512 | 124 | repo(new_sha) | ||
1513 | 125 | |||
1514 | 123 | def test_uncommitted_changes(self): | 126 | def test_uncommitted_changes(self): |
1515 | 124 | """GitRepo can detect uncommitted changes.""" | 127 | """GitRepo can detect uncommitted changes.""" |
1516 | 125 | # initial cloning | 128 | # initial cloning |
1517 | 126 | 129 | ||
1518 | === modified file 'buildbot/MANIFEST.cfg' | |||
1519 | --- buildbot/MANIFEST.cfg 2013-09-07 12:04:02 +0000 | |||
1520 | +++ buildbot/MANIFEST.cfg 2014-02-06 07:42:46 +0000 | |||
1521 | @@ -1,35 +1,57 @@ | |||
1522 | 1 | [anybox.recipe.openerp] | 1 | [anybox.recipe.openerp] |
1523 | 2 | watch = bzr lp:anybox.recipe.openerp | 2 | watch = bzr lp:anybox.recipe.openerp |
1524 | 3 | 3 | ||
1525 | 4 | [anybox.recipe.openerp-stable] | ||
1526 | 5 | watch = bzr lp:anybox.recipe.openerp/1.7 | ||
1527 | 6 | |||
1528 | 4 | [recipe-50] | 7 | [recipe-50] |
1535 | 5 | # A buildout to test latest version of the recipe in OpenERP 6.0 case | 8 | # A buildout to test latest version of the recipe in OpenERP 5.0 case |
1536 | 6 | # sale_margin is in extras and requires sale | 9 | # sale_margin is in extras and requires sale |
1537 | 7 | buildout = standalone recipe-50.cfg | 10 | buildout = bzr lp:anybox.recipe.openerp recipe-50.cfg subdir=buildbot |
1538 | 8 | openerp-addons = sale_margin | 11 | openerp-addons = sale_margin |
1539 | 9 | build-for = postgresql == 8.4 OR == 9.2 | 12 | build-for = postgresql == 8.4 OR == 9.2 |
1540 | 10 | watch = bzr lp:anybox.recipe.openerp | 13 | build-category = mature |
1541 | 14 | # OpenERP v5 won't work on python 2.7 | ||
1542 | 15 | build-requires = python == 2.6 | ||
1543 | 16 | |||
1544 | 17 | [stable-recipe-50] | ||
1545 | 18 | # A buildout to test latest version of the recipe in OpenERP 5.0 case | ||
1546 | 19 | # sale_margin is in extras and requires sale | ||
1547 | 20 | buildout = bzr lp:anybox.recipe.openerp/1.7 stable-recipe-50.cfg subdir=buildbot | ||
1548 | 21 | openerp-addons = sale_margin | ||
1549 | 22 | build-for = postgresql == 8.4 OR == 9.2 | ||
1550 | 11 | build-category = mature | 23 | build-category = mature |
1551 | 12 | # OpenERP v5 won't work on python 2.7 | 24 | # OpenERP v5 won't work on python 2.7 |
1552 | 13 | build-requires = python == 2.6 | 25 | build-requires = python == 2.6 |
1553 | 14 | 26 | ||
1554 | 15 | [recipe-60] | 27 | [recipe-60] |
1559 | 16 | buildout = standalone recipe-60.cfg | 28 | buildout = bzr lp:anybox.recipe.openerp recipe-60.cfg subdir=buildbot |
1560 | 17 | bootstrap-version = 1.7 | 29 | bootstrap-version = 1.7 |
1561 | 18 | build-for = postgresql == 8.4 | 30 | build-for = postgresql == 8.4 |
1562 | 19 | watch = bzr lp:anybox.recipe.openerp | 31 | build-category = mature |
1563 | 32 | |||
1564 | 33 | [stable-recipe-60] | ||
1565 | 34 | buildout = bzr lp:anybox.recipe.openerp/1.7 stable-recipe-60.cfg subdir=buildbot | ||
1566 | 35 | bootstrap-version = 1.7 | ||
1567 | 36 | build-for = postgresql == 8.4 | ||
1568 | 20 | build-category = mature | 37 | build-category = mature |
1569 | 21 | 38 | ||
1570 | 22 | [recipe-61] | 39 | [recipe-61] |
1571 | 23 | # A buildout to test latest version of the recipe in OpenERP 6.1 case | 40 | # A buildout to test latest version of the recipe in OpenERP 6.1 case |
1575 | 24 | buildout = standalone recipe-61.cfg | 41 | buildout = bzr lp:anybox.recipe.openerp recipe-61.cfg subdir=buildbot |
1576 | 25 | build-for = postgresql == 9.1 | 42 | build-for = postgresql == 9.1 |
1577 | 26 | watch = bzr lp:anybox.recipe.openerp | 43 | build-category = mature |
1578 | 44 | |||
1579 | 45 | [stable-recipe-61] | ||
1580 | 46 | # A buildout to test latest stable version of the recipe in OpenERP 6.1 case | ||
1581 | 47 | buildout = bzr lp:anybox.recipe.openerp/1.7 stable-recipe-61.cfg subdir=buildbot | ||
1582 | 48 | build-for = postgresql == 9.1 | ||
1583 | 27 | build-category = mature | 49 | build-category = mature |
1584 | 28 | 50 | ||
1585 | 29 | [recipe-60-custom] | 51 | [recipe-60-custom] |
1586 | 30 | # A buildout to test latest version of the recipe in an OpenERP 6.0 custom case | 52 | # A buildout to test latest version of the recipe in an OpenERP 6.0 custom case |
1587 | 31 | # (stock server, bzr addons) | 53 | # (stock server, bzr addons) |
1589 | 32 | buildout = standalone recipe-60.cfg | 54 | buildout = bzr lp:anybox.recipe.openerp/trunk recipe-60.cfg subdir=buildbot |
1590 | 33 | build-for = postgresql == 8.4 | 55 | build-for = postgresql == 8.4 |
1591 | 34 | watch = bzr lp:anybox.recipe.openerp | 56 | watch = bzr lp:anybox.recipe.openerp |
1592 | 35 | build-category = mature | 57 | build-category = mature |
1593 | @@ -37,39 +59,46 @@ | |||
1594 | 37 | [recipe-61-custom] | 59 | [recipe-61-custom] |
1595 | 38 | # A buildout to test latest version of the recipe in OpenERP 6.1 custom case | 60 | # A buildout to test latest version of the recipe in OpenERP 6.1 custom case |
1596 | 39 | # (bzr server and addons) | 61 | # (bzr server and addons) |
1598 | 40 | buildout = standalone recipe-61.cfg | 62 | buildout = bzr lp:anybox.recipe.openerp/trunk recipe-61.cfg subdir=buildbot |
1599 | 41 | build-for = postgresql == 9.1 | 63 | build-for = postgresql == 9.1 |
1600 | 42 | watch = bzr lp:anybox.recipe.openerp | 64 | watch = bzr lp:anybox.recipe.openerp |
1601 | 43 | build-category = mature | 65 | build-category = mature |
1602 | 44 | 66 | ||
1603 | 45 | [stable-recipe-7.0] | 67 | [stable-recipe-7.0] |
1604 | 46 | # A buildout to test latest stable revision of the recipe on OpenERP 7.0 | 68 | # A buildout to test latest stable revision of the recipe on OpenERP 7.0 |
1606 | 47 | buildout = standalone stable-recipe-7.0.cfg | 69 | buildout = bzr lp:anybox.recipe.openerp/1.7 stable-recipe-7.0.cfg subdir=buildbot |
1607 | 48 | build-for = postgresql >= 9.1 | 70 | build-for = postgresql >= 9.1 |
1608 | 49 | watch = bzr lp:anybox.recipe.openerp | ||
1609 | 50 | 71 | ||
1610 | 51 | [recipe-7.0] | 72 | [recipe-7.0] |
1611 | 52 | # A buildout to test latest revision of the recipe on OpenERP 7.0 | 73 | # A buildout to test latest revision of the recipe on OpenERP 7.0 |
1613 | 53 | buildout = standalone recipe-7.0.cfg | 74 | buildout = bzr lp:anybox.recipe.openerp/trunk recipe-7.0.cfg subdir=buildbot |
1614 | 54 | build-for = postgresql == 9.2 | 75 | build-for = postgresql == 9.2 |
1616 | 55 | watch = bzr lp:anybox.recipe.openerp | 76 | post-buildout-steps = nose |
1617 | 77 | test-openerp | ||
1618 | 78 | nose.tests = anybox.recipe.openerp/tests_with_openerp --logging-level=INFO | ||
1619 | 56 | 79 | ||
1620 | 57 | [recipe-trunk] | 80 | [recipe-trunk] |
1621 | 58 | # A buildout to test latest version of the recipe in OpenERP trunk | 81 | # A buildout to test latest version of the recipe in OpenERP trunk |
1625 | 59 | buildout = standalone recipe-trunk.cfg | 82 | buildout = bzr lp:anybox.recipe.openerp/trunk recipe-trunk.cfg subdir=buildbot |
1626 | 60 | build-for = postgresql >= 9.1 | 83 | build-for = postgresql > 9.2 |
1624 | 61 | watch = bzr lp:anybox.recipe.openerp | ||
1627 | 62 | 84 | ||
1628 | 63 | [recipe-61-nightly] | 85 | [recipe-61-nightly] |
1633 | 64 | # A buildout to test latest version of the recipe for OpenERP nightly build | 86 | # A buildout to test a latest revision of the recipe on an |
1634 | 65 | buildout = standalone recipe-nightly.cfg | 87 | # OpenERP nightly build |
1635 | 66 | build-for = postgresql == 9.1 | 88 | buildout = bzr lp:anybox.recipe.openerp recipe-nightly.cfg subdir=buildbot |
1636 | 67 | watch = bzr lp:anybox.recipe.openerp | 89 | build-for = postgresql == 9.1 |
1637 | 90 | build-category = experimental | ||
1638 | 91 | |||
1639 | 92 | [stable-recipe-61-nightly] | ||
1640 | 93 | # A buildout to test latest stable revision of the recipe on an | ||
1641 | 94 | # OpenERP nightly build | ||
1642 | 95 | buildout = bzr lp:anybox.recipe.openerp/1.7 stable-recipe-nightly.cfg subdir=buildbot | ||
1643 | 96 | build-for = postgresql == 9.1 | ||
1644 | 68 | build-category = experimental | 97 | build-category = experimental |
1645 | 69 | 98 | ||
1646 | 70 | [recipe-61-latest] | 99 | [recipe-61-latest] |
1647 | 71 | # A buildout to test latest version of the recipe for OpenERP nightly build | 100 | # A buildout to test latest version of the recipe for OpenERP nightly build |
1649 | 72 | buildout = standalone recipe-latest.cfg | 101 | buildout = bzr lp:anybox.recipe.openerp recipe-latest.cfg subdir=buildbot |
1650 | 73 | build-for = postgresql == 9.1 | 102 | build-for = postgresql == 9.1 |
1651 | 74 | watch = bzr lp:anybox.recipe.openerp | 103 | watch = bzr lp:anybox.recipe.openerp |
1652 | 75 | build-category = experimental | 104 | build-category = experimental |
1653 | 76 | 105 | ||
1654 | === added file 'buildbot/base_recipe.cfg' | |||
1655 | --- buildbot/base_recipe.cfg 1970-01-01 00:00:00 +0000 | |||
1656 | +++ buildbot/base_recipe.cfg 2014-02-06 07:42:46 +0000 | |||
1657 | @@ -0,0 +1,24 @@ | |||
1658 | 1 | [buildout] | ||
1659 | 2 | parts = openerp | ||
1660 | 3 | find-links = http://download.gna.org/pychart/ | ||
1661 | 4 | versions = versions | ||
1662 | 5 | extensions = gp.vcsdevelop | ||
1663 | 6 | vcs-extend-develop = | ||
1664 | 7 | bzr+http://bazaar.launchpad.net/~anybox/anybox.recipe.openerp/trunk#egg=anybox.recipe.openerp | ||
1665 | 8 | vcs-update = True | ||
1666 | 9 | |||
1667 | 10 | [openerp] | ||
1668 | 11 | recipe = anybox.recipe.openerp:server | ||
1669 | 12 | options.xmlrpc = False | ||
1670 | 13 | options.xmlrpcs = False | ||
1671 | 14 | options.netrpc = False | ||
1672 | 15 | eggs = nose | ||
1673 | 16 | openerp_scripts = nosetests=nosetests command-line-options=-d | ||
1674 | 17 | |||
1675 | 18 | [webclient] | ||
1676 | 19 | recipe = anybox.recipe.openerp:webclient | ||
1677 | 20 | version = 6.1-1 | ||
1678 | 21 | |||
1679 | 22 | [gtkclient] | ||
1680 | 23 | recipe = anybox.recipe.openerp:gtkclient | ||
1681 | 24 | version = nightly 6.1 latest | ||
1682 | 0 | 25 | ||
1683 | === modified file 'buildbot/recipe-50.cfg' | |||
1684 | --- buildbot/recipe-50.cfg 2013-08-04 10:35:20 +0000 | |||
1685 | +++ buildbot/recipe-50.cfg 2014-02-06 07:42:46 +0000 | |||
1686 | @@ -1,31 +1,14 @@ | |||
1687 | 1 | [buildout] | 1 | [buildout] |
1697 | 2 | parts = openerp | 2 | extends = base_recipe.cfg |
1689 | 3 | |||
1690 | 4 | versions = versions | ||
1691 | 5 | find-links = http://download.gna.org/pychart/ | ||
1692 | 6 | |||
1693 | 7 | extensions = gp.vcsdevelop | ||
1694 | 8 | vcs-extend-develop = | ||
1695 | 9 | bzr+http://bazaar.launchpad.net/~anybox/anybox.recipe.openerp/trunk#egg=anyb | ||
1696 | 10 | vcs-update = True | ||
1698 | 11 | 3 | ||
1699 | 12 | [openerp] | 4 | [openerp] |
1700 | 13 | recipe = anybox.recipe.openerp:server | ||
1701 | 14 | version = bzr lp:openobject-server/5.0 openerp-5.0 last:1 | 5 | version = bzr lp:openobject-server/5.0 openerp-5.0 last:1 |
1702 | 15 | addons = bzr lp:openobject-addons/5.0 addons-5.0 last:1 | 6 | addons = bzr lp:openobject-addons/5.0 addons-5.0 last:1 |
1703 | 16 | bzr lp:openobject-addons/extra-5.0 addons-5.0-extra last:1 bzr-init=stacked-branch | 7 | bzr lp:openobject-addons/extra-5.0 addons-5.0-extra last:1 bzr-init=stacked-branch |
1704 | 17 | |||
1705 | 18 | eggs = formencode | 8 | eggs = formencode |
1706 | 19 | pydns | 9 | pydns |
1707 | 20 | 10 | ||
1708 | 21 | options.xmlrpc = False | ||
1709 | 22 | options.netrpc = True | ||
1710 | 23 | options.xmlrpcs = False | ||
1711 | 24 | xmlrpc_port = False | ||
1712 | 25 | xmlrpcs_port = False | ||
1713 | 26 | |||
1714 | 27 | [gtkclient] | 11 | [gtkclient] |
1715 | 28 | recipe = anybox.recipe.openerp:gtkclient | ||
1716 | 29 | version = 5.0.16 | 12 | version = 5.0.16 |
1717 | 30 | eggs = pytz | 13 | eggs = pytz |
1718 | 31 | 14 | ||
1719 | 32 | 15 | ||
1720 | === modified file 'buildbot/recipe-60-custom.cfg' | |||
1721 | --- buildbot/recipe-60-custom.cfg 2013-08-02 15:52:01 +0000 | |||
1722 | +++ buildbot/recipe-60-custom.cfg 2014-02-06 07:42:46 +0000 | |||
1723 | @@ -1,12 +1,13 @@ | |||
1724 | 1 | [buildout] | 1 | [buildout] |
1733 | 2 | parts = openerp | 2 | extends = base_recipe.cfg |
1734 | 3 | extensions = gp.vcsdevelop | 3 | |
1735 | 4 | vcs-extend-develop = | 4 | [openerp] |
1736 | 5 | bzr+http://bazaar.launchpad.net/~anybox/anybox.recipe.openerp/trunk#egg=anybox.recipe.openerp | 5 | version = 6.0.3 |
1737 | 6 | vcs-update = True | 6 | addons = bzr lp:~anybox/openobject-addons/6.0.3-bugfix addons-6.0 last:1 |
1738 | 7 | 7 | eggs = | |
1739 | 8 | versions = versions | 8 | formencode |
1740 | 9 | find-links = http://download.gna.org/pychart/ | 9 | pydns |
1741 | 10 | |||
1742 | 10 | 11 | ||
1743 | 11 | [versions] | 12 | [versions] |
1744 | 12 | Babel = 0.9.6 | 13 | Babel = 0.9.6 |
1745 | @@ -40,13 +41,3 @@ | |||
1746 | 40 | zc.buildout = 1.5.2 | 41 | zc.buildout = 1.5.2 |
1747 | 41 | zc.recipe.egg = 1.3.2 | 42 | zc.recipe.egg = 1.3.2 |
1748 | 42 | 43 | ||
1749 | 43 | [openerp] | ||
1750 | 44 | recipe = anybox.recipe.openerp:server | ||
1751 | 45 | eggs = | ||
1752 | 46 | formencode | ||
1753 | 47 | pydns | ||
1754 | 48 | |||
1755 | 49 | version = 6.0.3 | ||
1756 | 50 | addons = bzr lp:~anybox/openobject-addons/6.0.3-bugfix addons-6.0 last:1 | ||
1757 | 51 | clean = true | ||
1758 | 52 | |||
1759 | 53 | 44 | ||
1760 | === modified file 'buildbot/recipe-60.cfg' | |||
1761 | --- buildbot/recipe-60.cfg 2013-08-02 16:20:41 +0000 | |||
1762 | +++ buildbot/recipe-60.cfg 2014-02-06 07:42:46 +0000 | |||
1763 | @@ -1,22 +1,13 @@ | |||
1764 | 1 | [buildout] | 1 | [buildout] |
1773 | 2 | parts = openerp | 2 | extends = base_recipe.cfg |
1774 | 3 | extensions = gp.vcsdevelop | 3 | |
1767 | 4 | versions = versions | ||
1768 | 5 | find-links = http://download.gna.org/pychart/ | ||
1769 | 6 | #vcs-extend-develop = | ||
1770 | 7 | # bzr+http://bazaar.launchpad.net/~anybox/anybox.recipe.openerp/trunk#egg=anyb | ||
1771 | 8 | #vcs-update = True | ||
1772 | 9 | develop = /home/gracinet/openerp/recipe/anybox.recipe.openerp | ||
1775 | 10 | [openerp] | 4 | [openerp] |
1776 | 11 | recipe = anybox.recipe.openerp:server | ||
1777 | 12 | version = 6.0.4 | 5 | version = 6.0.4 |
1778 | 13 | 6 | ||
1779 | 14 | [webclient] | 7 | [webclient] |
1780 | 15 | recipe = anybox.recipe.openerp:server | ||
1781 | 16 | version = 6.0.4 | 8 | version = 6.0.4 |
1782 | 17 | 9 | ||
1783 | 18 | [gtkclient] | 10 | [gtkclient] |
1784 | 19 | recipe = anybox.recipe.openerp:gtkclient | ||
1785 | 20 | version = 6.0.4 | 11 | version = 6.0.4 |
1786 | 21 | 12 | ||
1787 | 22 | [versions] | 13 | [versions] |
1788 | 23 | 14 | ||
1789 | === modified file 'buildbot/recipe-61-custom.cfg' | |||
1790 | --- buildbot/recipe-61-custom.cfg 2013-08-02 15:52:01 +0000 | |||
1791 | +++ buildbot/recipe-61-custom.cfg 2014-02-06 07:42:46 +0000 | |||
1792 | @@ -1,21 +1,11 @@ | |||
1793 | 1 | [buildout] | 1 | [buildout] |
1801 | 2 | parts = openerp | 2 | extends = base_recipe.cfg |
1795 | 3 | find-links = http://download.gna.org/pychart/ | ||
1796 | 4 | versions = versions | ||
1797 | 5 | extensions = gp.vcsdevelop | ||
1798 | 6 | vcs-extend-develop = | ||
1799 | 7 | bzr+http://bazaar.launchpad.net/~anybox/anybox.recipe.openerp/trunk#egg=anybox.recipe.openerp | ||
1800 | 8 | vcs-update = True | ||
1802 | 9 | 3 | ||
1803 | 10 | [openerp] | 4 | [openerp] |
1805 | 11 | recipe = anybox.recipe.openerp:server | 5 | # TODO what is exactly custom here ? |
1806 | 12 | version = bzr lp:openobject-server/6.1 openerp-6.1 last:1 | 6 | version = bzr lp:openobject-server/6.1 openerp-6.1 last:1 |
1807 | 13 | addons = bzr lp:openobject-addons/6.1 addons-6.1 last:1 | 7 | addons = bzr lp:openobject-addons/6.1 addons-6.1 last:1 |
1808 | 14 | bzr lp:openerp-web/6.1 addons-web last:1 subdir=addons | 8 | bzr lp:openerp-web/6.1 addons-web last:1 subdir=addons |
1809 | 15 | clean = true | ||
1810 | 16 | options.xmlrpc = False | ||
1811 | 17 | options.xmlrpcs = False | ||
1812 | 18 | options.netrpc = False | ||
1813 | 19 | 9 | ||
1814 | 20 | [versions] | 10 | [versions] |
1815 | 21 | babel = 0.9.6 | 11 | babel = 0.9.6 |
1816 | 22 | 12 | ||
1817 | === modified file 'buildbot/recipe-61.cfg' | |||
1818 | --- buildbot/recipe-61.cfg 2013-08-02 16:20:41 +0000 | |||
1819 | +++ buildbot/recipe-61.cfg 2014-02-06 07:42:46 +0000 | |||
1820 | @@ -1,22 +1,13 @@ | |||
1821 | 1 | [buildout] | 1 | [buildout] |
1829 | 2 | parts = openerp | 2 | extends = base_recipe.cfg |
1823 | 3 | extensions = gp.vcsdevelop | ||
1824 | 4 | versions = versions | ||
1825 | 5 | find-links = http://download.gna.org/pychart/ | ||
1826 | 6 | vcs-extend-develop = | ||
1827 | 7 | bzr+http://bazaar.launchpad.net/~anybox/anybox.recipe.openerp/trunk#egg=anyb | ||
1828 | 8 | vcs-update = True | ||
1830 | 9 | 3 | ||
1831 | 10 | [openerp] | 4 | [openerp] |
1832 | 11 | recipe = anybox.recipe.openerp:server | ||
1833 | 12 | version = 6.1-1 | 5 | version = 6.1-1 |
1834 | 13 | 6 | ||
1835 | 14 | [webclient] | 7 | [webclient] |
1836 | 15 | recipe = anybox.recipe.openerp:server | ||
1837 | 16 | version = 6.1-1 | 8 | version = 6.1-1 |
1838 | 17 | 9 | ||
1839 | 18 | [gtkclient] | 10 | [gtkclient] |
1840 | 19 | recipe = anybox.recipe.openerp:gtkclient | ||
1841 | 20 | version = 6.1-1 | 11 | version = 6.1-1 |
1842 | 21 | 12 | ||
1843 | 22 | [versions] | 13 | [versions] |
1844 | 23 | 14 | ||
1845 | === modified file 'buildbot/recipe-7.0.cfg' | |||
1846 | --- buildbot/recipe-7.0.cfg 2013-08-02 16:20:41 +0000 | |||
1847 | +++ buildbot/recipe-7.0.cfg 2014-02-06 07:42:46 +0000 | |||
1848 | @@ -1,21 +1,10 @@ | |||
1849 | 1 | [buildout] | 1 | [buildout] |
1857 | 2 | parts = openerp | 2 | extends = base_recipe.cfg |
1851 | 3 | find-links = http://download.gna.org/pychart/ | ||
1852 | 4 | versions = versions | ||
1853 | 5 | extensions = gp.vcsdevelop | ||
1854 | 6 | vcs-extend-develop = | ||
1855 | 7 | bzr+http://bazaar.launchpad.net/~anybox/anybox.recipe.openerp/trunk#egg=anybox.recipe.openerp | ||
1856 | 8 | vcs-update = True | ||
1858 | 9 | 3 | ||
1859 | 10 | [openerp] | 4 | [openerp] |
1860 | 11 | recipe = anybox.recipe.openerp:server | ||
1861 | 12 | version = bzr lp:openobject-server/7.0 openerp-7.0 last:1 | 5 | version = bzr lp:openobject-server/7.0 openerp-7.0 last:1 |
1862 | 13 | addons = bzr lp:openobject-addons/7.0 addons-7.0 last:1 | 6 | addons = bzr lp:openobject-addons/7.0 addons-7.0 last:1 |
1863 | 14 | bzr lp:openerp-web/7.0 addons-web-7.0 last:1 subdir=addons | 7 | bzr lp:openerp-web/7.0 addons-web-7.0 last:1 subdir=addons |
1864 | 15 | clean = true | ||
1865 | 16 | options.xmlrpc = False | ||
1866 | 17 | options.xmlrpcs = False | ||
1867 | 18 | options.netrpc = False | ||
1868 | 19 | 8 | ||
1869 | 20 | [versions] | 9 | [versions] |
1870 | 21 | babel = 0.9.6 | 10 | babel = 0.9.6 |
1871 | 22 | 11 | ||
1872 | === modified file 'buildbot/recipe-latest.cfg' | |||
1873 | --- buildbot/recipe-latest.cfg 2013-08-02 16:20:41 +0000 | |||
1874 | +++ buildbot/recipe-latest.cfg 2014-02-06 07:42:46 +0000 | |||
1875 | @@ -1,22 +1,13 @@ | |||
1876 | 1 | [buildout] | 1 | [buildout] |
1884 | 2 | parts = openerp | 2 | extends = base_recipe.cfg |
1878 | 3 | extensions = gp.vcsdevelop | ||
1879 | 4 | versions = versions | ||
1880 | 5 | find-links = http://download.gna.org/pychart/ | ||
1881 | 6 | vcs-extend-develop = | ||
1882 | 7 | bzr+http://bazaar.launchpad.net/~anybox/anybox.recipe.openerp/trunk#egg=anyb | ||
1883 | 8 | vcs-update = True | ||
1885 | 9 | 3 | ||
1886 | 10 | [openerp] | 4 | [openerp] |
1889 | 11 | recipe = anybox.recipe.openerp:server | 5 | version = nightly 6.1 latest |
1888 | 12 | version = nightly 6.1 20120217-003606 | ||
1890 | 13 | 6 | ||
1891 | 14 | [webclient] | 7 | [webclient] |
1892 | 15 | recipe = anybox.recipe.openerp:server | ||
1893 | 16 | version = 6.1-1 | 8 | version = 6.1-1 |
1894 | 17 | 9 | ||
1895 | 18 | [gtkclient] | 10 | [gtkclient] |
1896 | 19 | recipe = anybox.recipe.openerp:gtkclient | ||
1897 | 20 | version = nightly 6.1 latest | 11 | version = nightly 6.1 latest |
1898 | 21 | 12 | ||
1899 | 22 | [versions] | 13 | [versions] |
1900 | 23 | 14 | ||
1901 | === modified file 'buildbot/recipe-nightly.cfg' | |||
1902 | --- buildbot/recipe-nightly.cfg 2013-08-02 16:20:41 +0000 | |||
1903 | +++ buildbot/recipe-nightly.cfg 2014-02-06 07:42:46 +0000 | |||
1904 | @@ -1,22 +1,13 @@ | |||
1905 | 1 | [buildout] | 1 | [buildout] |
1913 | 2 | parts = openerp | 2 | extends = base_recipe.cfg |
1907 | 3 | extensions = gp.vcsdevelop | ||
1908 | 4 | versions = versions | ||
1909 | 5 | find-links = http://download.gna.org/pychart/ | ||
1910 | 6 | vcs-extend-develop = | ||
1911 | 7 | bzr+http://bazaar.launchpad.net/~anybox/anybox.recipe.openerp/trunk#egg=anyb | ||
1912 | 8 | vcs-update = True | ||
1914 | 9 | 3 | ||
1915 | 10 | [openerp] | 4 | [openerp] |
1916 | 11 | recipe = anybox.recipe.openerp:server | ||
1917 | 12 | version = nightly 6.1 20120217-003606 | 5 | version = nightly 6.1 20120217-003606 |
1918 | 13 | 6 | ||
1919 | 14 | [webclient] | 7 | [webclient] |
1920 | 15 | recipe = anybox.recipe.openerp:server | ||
1921 | 16 | version = 6.1-1 | 8 | version = 6.1-1 |
1922 | 17 | 9 | ||
1923 | 18 | [gtkclient] | 10 | [gtkclient] |
1924 | 19 | recipe = anybox.recipe.openerp:gtkclient | ||
1925 | 20 | version = nightly 6.1 20120229-230351 | 11 | version = nightly 6.1 20120229-230351 |
1926 | 21 | 12 | ||
1927 | 22 | [versions] | 13 | [versions] |
1928 | 23 | 14 | ||
1929 | === modified file 'buildbot/recipe-trunk.cfg' | |||
1930 | --- buildbot/recipe-trunk.cfg 2013-08-02 15:52:01 +0000 | |||
1931 | +++ buildbot/recipe-trunk.cfg 2014-02-06 07:42:46 +0000 | |||
1932 | @@ -1,21 +1,11 @@ | |||
1933 | 1 | [buildout] | 1 | [buildout] |
1941 | 2 | parts = openerp | 2 | extends = base_recipe.cfg |
1935 | 3 | find-links = http://download.gna.org/pychart/ | ||
1936 | 4 | versions = versions | ||
1937 | 5 | extensions = gp.vcsdevelop | ||
1938 | 6 | vcs-extend-develop = | ||
1939 | 7 | bzr+http://bazaar.launchpad.net/~anybox/anybox.recipe.openerp/trunk#egg=anybox.recipe.openerp | ||
1940 | 8 | vcs-update = True | ||
1942 | 9 | 3 | ||
1943 | 10 | [openerp] | 4 | [openerp] |
1944 | 11 | recipe = anybox.recipe.openerp:server | 5 | recipe = anybox.recipe.openerp:server |
1945 | 12 | version = bzr lp:openobject-server openerp-trunk last:1 | 6 | version = bzr lp:openobject-server openerp-trunk last:1 |
1946 | 13 | addons = bzr lp:openobject-addons addons-trunk last:1 | 7 | addons = bzr lp:openobject-addons addons-trunk last:1 |
1947 | 14 | bzr lp:openerp-web addons-web-trunk last:1 subdir=addons | 8 | bzr lp:openerp-web addons-web-trunk last:1 subdir=addons |
1948 | 15 | clean = true | ||
1949 | 16 | options.xmlrpc = False | ||
1950 | 17 | options.xmlrpcs = False | ||
1951 | 18 | options.netrpc = False | ||
1952 | 19 | 9 | ||
1953 | 20 | [versions] | 10 | [versions] |
1954 | 21 | babel = 0.9.6 | 11 | babel = 0.9.6 |
1955 | 22 | 12 | ||
1956 | === added file 'buildbot/stable-recipe-50.cfg' | |||
1957 | --- buildbot/stable-recipe-50.cfg 1970-01-01 00:00:00 +0000 | |||
1958 | +++ buildbot/stable-recipe-50.cfg 2014-02-06 07:42:46 +0000 | |||
1959 | @@ -0,0 +1,4 @@ | |||
1960 | 1 | [buildout] | ||
1961 | 2 | extends=recipe-50.cfg | ||
1962 | 3 | vcs-extend-develop = | ||
1963 | 4 | bzr+http://bazaar.launchpad.net/~anybox/anybox.recipe.openerp/1.7#egg=anyb | ||
1964 | 0 | 5 | ||
1965 | === added file 'buildbot/stable-recipe-60.cfg' | |||
1966 | --- buildbot/stable-recipe-60.cfg 1970-01-01 00:00:00 +0000 | |||
1967 | +++ buildbot/stable-recipe-60.cfg 2014-02-06 07:42:46 +0000 | |||
1968 | @@ -0,0 +1,4 @@ | |||
1969 | 1 | [buildout] | ||
1970 | 2 | extends = recipe-60.cfg | ||
1971 | 3 | vcs-extend-develop = | ||
1972 | 4 | bzr+http://bazaar.launchpad.net/~anybox/anybox.recipe.openerp/1.7#egg=anyb | ||
1973 | 0 | 5 | ||
1974 | === added file 'buildbot/stable-recipe-61.cfg' | |||
1975 | --- buildbot/stable-recipe-61.cfg 1970-01-01 00:00:00 +0000 | |||
1976 | +++ buildbot/stable-recipe-61.cfg 2014-02-06 07:42:46 +0000 | |||
1977 | @@ -0,0 +1,4 @@ | |||
1978 | 1 | [buildout] | ||
1979 | 2 | extends = recipe-61.cfg | ||
1980 | 3 | vcs-extend-develop = | ||
1981 | 4 | bzr+http://bazaar.launchpad.net/~anybox/anybox.recipe.openerp/1.7#egg=anyb | ||
1982 | 0 | 5 | ||
1983 | === added file 'buildbot/stable-recipe-7.0.cfg' | |||
1984 | --- buildbot/stable-recipe-7.0.cfg 1970-01-01 00:00:00 +0000 | |||
1985 | +++ buildbot/stable-recipe-7.0.cfg 2014-02-06 07:42:46 +0000 | |||
1986 | @@ -0,0 +1,4 @@ | |||
1987 | 1 | [buildout] | ||
1988 | 2 | extends = recipe-7.0.cfg | ||
1989 | 3 | vcs-extend-develop = | ||
1990 | 4 | bzr+http://bazaar.launchpad.net/~anybox/anybox.recipe.openerp/1.7#egg=anybox.recipe.openerp | ||
1991 | 0 | 5 | ||
1992 | === removed file 'buildbot/stable-recipe-7.0.cfg' | |||
1993 | --- buildbot/stable-recipe-7.0.cfg 2013-09-07 12:04:02 +0000 | |||
1994 | +++ buildbot/stable-recipe-7.0.cfg 1970-01-01 00:00:00 +0000 | |||
1995 | @@ -1,42 +0,0 @@ | |||
1996 | 1 | [buildout] | ||
1997 | 2 | # A buildout to test the support branch for the latest major version of the | ||
1998 | 3 | # recipe | ||
1999 | 4 | parts = openerp | ||
2000 | 5 | find-links = http://download.gna.org/pychart/ | ||
2001 | 6 | versions = versions | ||
2002 | 7 | extensions = gp.vcsdevelop | ||
2003 | 8 | vcs-extend-develop = | ||
2004 | 9 | bzr+http://bazaar.launchpad.net/~anybox/anybox.recipe.openerp/1.7#egg=anybox.recipe.openerp | ||
2005 | 10 | vcs-update = True | ||
2006 | 11 | |||
2007 | 12 | [openerp] | ||
2008 | 13 | recipe = anybox.recipe.openerp:server | ||
2009 | 14 | version = bzr lp:openobject-server/7.0 openerp-7.0 last:1 | ||
2010 | 15 | addons = bzr lp:openobject-addons/7.0 addons-7.0 last:1 | ||
2011 | 16 | bzr lp:openerp-web/7.0 addons-web-7.0 last:1 subdir=addons | ||
2012 | 17 | clean = true | ||
2013 | 18 | options.xmlrpc = False | ||
2014 | 19 | options.xmlrpcs = False | ||
2015 | 20 | options.netrpc = False | ||
2016 | 21 | |||
2017 | 22 | [versions] | ||
2018 | 23 | babel = 0.9.6 | ||
2019 | 24 | PIL = 1.1.7 | ||
2020 | 25 | pywebdav = 0.9.4.1 | ||
2021 | 26 | PyXML = 0.8.4 | ||
2022 | 27 | pyyaml = 3.10 | ||
2023 | 28 | werkzeug = 0.8.3 | ||
2024 | 29 | zsi = 2.0-rc3 | ||
2025 | 30 | feedparser = 5.1.1 | ||
2026 | 31 | gdata = 2.0.16 | ||
2027 | 32 | lxml = 2.3.3 | ||
2028 | 33 | psycopg2 = 2.4.4 | ||
2029 | 34 | pydot = 1.0.28 | ||
2030 | 35 | pyparsing = 1.5.6 | ||
2031 | 36 | python-dateutil = 1.5 | ||
2032 | 37 | python-ldap = 2.4.9 | ||
2033 | 38 | python-openid = 2.2.5 | ||
2034 | 39 | pytz = 2012b | ||
2035 | 40 | vatnumber = 1.0 | ||
2036 | 41 | vobject = 0.8.1c | ||
2037 | 42 | xlwt = 0.7.3 | ||
2038 | 43 | 0 | ||
2039 | === added file 'buildbot/stable-recipe-nightly.cfg' | |||
2040 | --- buildbot/stable-recipe-nightly.cfg 1970-01-01 00:00:00 +0000 | |||
2041 | +++ buildbot/stable-recipe-nightly.cfg 2014-02-06 07:42:46 +0000 | |||
2042 | @@ -0,0 +1,4 @@ | |||
2043 | 1 | [buildout] | ||
2044 | 2 | extends = recipe-nightly.cfg | ||
2045 | 3 | vcs-extend-develop = | ||
2046 | 4 | bzr+http://bazaar.launchpad.net/~anybox/anybox.recipe.openerp/1.7#egg=anyb | ||
2047 | 0 | 5 | ||
2048 | === added directory 'doc' | |||
2049 | === added file 'doc/Makefile' | |||
2050 | --- doc/Makefile 1970-01-01 00:00:00 +0000 | |||
2051 | +++ doc/Makefile 2014-02-06 07:42:46 +0000 | |||
2052 | @@ -0,0 +1,177 @@ | |||
2053 | 1 | # Makefile for Sphinx documentation | ||
2054 | 2 | # | ||
2055 | 3 | |||
2056 | 4 | # You can set these variables from the command line. | ||
2057 | 5 | SPHINXOPTS = | ||
2058 | 6 | SPHINXBUILD = sphinx-build | ||
2059 | 7 | PAPER = | ||
2060 | 8 | BUILDDIR = sphinx_build | ||
2061 | 9 | |||
2062 | 10 | # User-friendly check for sphinx-build | ||
2063 | 11 | ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1) | ||
2064 | 12 | $(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/) | ||
2065 | 13 | endif | ||
2066 | 14 | |||
2067 | 15 | # Internal variables. | ||
2068 | 16 | PAPEROPT_a4 = -D latex_paper_size=a4 | ||
2069 | 17 | PAPEROPT_letter = -D latex_paper_size=letter | ||
2070 | 18 | ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . | ||
2071 | 19 | # the i18n builder cannot share the environment and doctrees with the others | ||
2072 | 20 | I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . | ||
2073 | 21 | |||
2074 | 22 | .PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext | ||
2075 | 23 | |||
2076 | 24 | help: | ||
2077 | 25 | @echo "Please use \`make <target>' where <target> is one of" | ||
2078 | 26 | @echo " html to make standalone HTML files" | ||
2079 | 27 | @echo " dirhtml to make HTML files named index.html in directories" | ||
2080 | 28 | @echo " singlehtml to make a single large HTML file" | ||
2081 | 29 | @echo " pickle to make pickle files" | ||
2082 | 30 | @echo " json to make JSON files" | ||
2083 | 31 | @echo " htmlhelp to make HTML files and a HTML help project" | ||
2084 | 32 | @echo " qthelp to make HTML files and a qthelp project" | ||
2085 | 33 | @echo " devhelp to make HTML files and a Devhelp project" | ||
2086 | 34 | @echo " epub to make an epub" | ||
2087 | 35 | @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" | ||
2088 | 36 | @echo " latexpdf to make LaTeX files and run them through pdflatex" | ||
2089 | 37 | @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx" | ||
2090 | 38 | @echo " text to make text files" | ||
2091 | 39 | @echo " man to make manual pages" | ||
2092 | 40 | @echo " texinfo to make Texinfo files" | ||
2093 | 41 | @echo " info to make Texinfo files and run them through makeinfo" | ||
2094 | 42 | @echo " gettext to make PO message catalogs" | ||
2095 | 43 | @echo " changes to make an overview of all changed/added/deprecated items" | ||
2096 | 44 | @echo " xml to make Docutils-native XML files" | ||
2097 | 45 | @echo " pseudoxml to make pseudoxml-XML files for display purposes" | ||
2098 | 46 | @echo " linkcheck to check all external links for integrity" | ||
2099 | 47 | @echo " doctest to run all doctests embedded in the documentation (if enabled)" | ||
2100 | 48 | |||
2101 | 49 | clean: | ||
2102 | 50 | rm -rf $(BUILDDIR)/* | ||
2103 | 51 | |||
2104 | 52 | html: | ||
2105 | 53 | $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html | ||
2106 | 54 | @echo | ||
2107 | 55 | @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." | ||
2108 | 56 | |||
2109 | 57 | dirhtml: | ||
2110 | 58 | $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml | ||
2111 | 59 | @echo | ||
2112 | 60 | @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." | ||
2113 | 61 | |||
2114 | 62 | singlehtml: | ||
2115 | 63 | $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml | ||
2116 | 64 | @echo | ||
2117 | 65 | @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." | ||
2118 | 66 | |||
2119 | 67 | pickle: | ||
2120 | 68 | $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle | ||
2121 | 69 | @echo | ||
2122 | 70 | @echo "Build finished; now you can process the pickle files." | ||
2123 | 71 | |||
2124 | 72 | json: | ||
2125 | 73 | $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json | ||
2126 | 74 | @echo | ||
2127 | 75 | @echo "Build finished; now you can process the JSON files." | ||
2128 | 76 | |||
2129 | 77 | htmlhelp: | ||
2130 | 78 | $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp | ||
2131 | 79 | @echo | ||
2132 | 80 | @echo "Build finished; now you can run HTML Help Workshop with the" \ | ||
2133 | 81 | ".hhp project file in $(BUILDDIR)/htmlhelp." | ||
2134 | 82 | |||
2135 | 83 | qthelp: | ||
2136 | 84 | $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp | ||
2137 | 85 | @echo | ||
2138 | 86 | @echo "Build finished; now you can run "qcollectiongenerator" with the" \ | ||
2139 | 87 | ".qhcp project file in $(BUILDDIR)/qthelp, like this:" | ||
2140 | 88 | @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/OpenERPbuildoutrecipe.qhcp" | ||
2141 | 89 | @echo "To view the help file:" | ||
2142 | 90 | @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/OpenERPbuildoutrecipe.qhc" | ||
2143 | 91 | |||
2144 | 92 | devhelp: | ||
2145 | 93 | $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp | ||
2146 | 94 | @echo | ||
2147 | 95 | @echo "Build finished." | ||
2148 | 96 | @echo "To view the help file:" | ||
2149 | 97 | @echo "# mkdir -p $$HOME/.local/share/devhelp/OpenERPbuildoutrecipe" | ||
2150 | 98 | @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/OpenERPbuildoutrecipe" | ||
2151 | 99 | @echo "# devhelp" | ||
2152 | 100 | |||
2153 | 101 | epub: | ||
2154 | 102 | $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub | ||
2155 | 103 | @echo | ||
2156 | 104 | @echo "Build finished. The epub file is in $(BUILDDIR)/epub." | ||
2157 | 105 | |||
2158 | 106 | latex: | ||
2159 | 107 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex | ||
2160 | 108 | @echo | ||
2161 | 109 | @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." | ||
2162 | 110 | @echo "Run \`make' in that directory to run these through (pdf)latex" \ | ||
2163 | 111 | "(use \`make latexpdf' here to do that automatically)." | ||
2164 | 112 | |||
2165 | 113 | latexpdf: | ||
2166 | 114 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex | ||
2167 | 115 | @echo "Running LaTeX files through pdflatex..." | ||
2168 | 116 | $(MAKE) -C $(BUILDDIR)/latex all-pdf | ||
2169 | 117 | @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." | ||
2170 | 118 | |||
2171 | 119 | latexpdfja: | ||
2172 | 120 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex | ||
2173 | 121 | @echo "Running LaTeX files through platex and dvipdfmx..." | ||
2174 | 122 | $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja | ||
2175 | 123 | @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." | ||
2176 | 124 | |||
2177 | 125 | text: | ||
2178 | 126 | $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text | ||
2179 | 127 | @echo | ||
2180 | 128 | @echo "Build finished. The text files are in $(BUILDDIR)/text." | ||
2181 | 129 | |||
2182 | 130 | man: | ||
2183 | 131 | $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man | ||
2184 | 132 | @echo | ||
2185 | 133 | @echo "Build finished. The manual pages are in $(BUILDDIR)/man." | ||
2186 | 134 | |||
2187 | 135 | texinfo: | ||
2188 | 136 | $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo | ||
2189 | 137 | @echo | ||
2190 | 138 | @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." | ||
2191 | 139 | @echo "Run \`make' in that directory to run these through makeinfo" \ | ||
2192 | 140 | "(use \`make info' here to do that automatically)." | ||
2193 | 141 | |||
2194 | 142 | info: | ||
2195 | 143 | $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo | ||
2196 | 144 | @echo "Running Texinfo files through makeinfo..." | ||
2197 | 145 | make -C $(BUILDDIR)/texinfo info | ||
2198 | 146 | @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." | ||
2199 | 147 | |||
2200 | 148 | gettext: | ||
2201 | 149 | $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale | ||
2202 | 150 | @echo | ||
2203 | 151 | @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." | ||
2204 | 152 | |||
2205 | 153 | changes: | ||
2206 | 154 | $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes | ||
2207 | 155 | @echo | ||
2208 | 156 | @echo "The overview file is in $(BUILDDIR)/changes." | ||
2209 | 157 | |||
2210 | 158 | linkcheck: | ||
2211 | 159 | $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck | ||
2212 | 160 | @echo | ||
2213 | 161 | @echo "Link check complete; look for any errors in the above output " \ | ||
2214 | 162 | "or in $(BUILDDIR)/linkcheck/output.txt." | ||
2215 | 163 | |||
2216 | 164 | doctest: | ||
2217 | 165 | $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest | ||
2218 | 166 | @echo "Testing of doctests in the sources finished, look at the " \ | ||
2219 | 167 | "results in $(BUILDDIR)/doctest/output.txt." | ||
2220 | 168 | |||
2221 | 169 | xml: | ||
2222 | 170 | $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml | ||
2223 | 171 | @echo | ||
2224 | 172 | @echo "Build finished. The XML files are in $(BUILDDIR)/xml." | ||
2225 | 173 | |||
2226 | 174 | pseudoxml: | ||
2227 | 175 | $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml | ||
2228 | 176 | @echo | ||
2229 | 177 | @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml." | ||
2230 | 0 | 178 | ||
2231 | === added directory 'doc/apidoc' | |||
2232 | === added file 'doc/apidoc/anybox.recipe.openerp.rst' | |||
2233 | --- doc/apidoc/anybox.recipe.openerp.rst 1970-01-01 00:00:00 +0000 | |||
2234 | +++ doc/apidoc/anybox.recipe.openerp.rst 2014-02-06 07:42:46 +0000 | |||
2235 | @@ -0,0 +1,75 @@ | |||
2236 | 1 | anybox.recipe.openerp Package | ||
2237 | 2 | ============================= | ||
2238 | 3 | |||
2239 | 4 | :mod:`anybox.recipe.openerp` Package | ||
2240 | 5 | ------------------------------------ | ||
2241 | 6 | |||
2242 | 7 | .. automodule:: anybox.recipe.openerp | ||
2243 | 8 | :members: | ||
2244 | 9 | :undoc-members: | ||
2245 | 10 | :show-inheritance: | ||
2246 | 11 | |||
2247 | 12 | :mod:`base` Module | ||
2248 | 13 | ------------------ | ||
2249 | 14 | |||
2250 | 15 | .. automodule:: anybox.recipe.openerp.base | ||
2251 | 16 | :members: | ||
2252 | 17 | :undoc-members: | ||
2253 | 18 | :show-inheritance: | ||
2254 | 19 | |||
2255 | 20 | :mod:`devtools` Module | ||
2256 | 21 | ---------------------- | ||
2257 | 22 | |||
2258 | 23 | .. automodule:: anybox.recipe.openerp.devtools | ||
2259 | 24 | :members: | ||
2260 | 25 | :undoc-members: | ||
2261 | 26 | :show-inheritance: | ||
2262 | 27 | |||
2263 | 28 | :mod:`gtkclient` Module | ||
2264 | 29 | ----------------------- | ||
2265 | 30 | |||
2266 | 31 | .. automodule:: anybox.recipe.openerp.gtkclient | ||
2267 | 32 | :members: | ||
2268 | 33 | :undoc-members: | ||
2269 | 34 | :show-inheritance: | ||
2270 | 35 | |||
2271 | 36 | :mod:`server` Module | ||
2272 | 37 | -------------------- | ||
2273 | 38 | |||
2274 | 39 | .. automodule:: anybox.recipe.openerp.server | ||
2275 | 40 | :members: | ||
2276 | 41 | :undoc-members: | ||
2277 | 42 | :show-inheritance: | ||
2278 | 43 | |||
2279 | 44 | :mod:`testing` Module | ||
2280 | 45 | --------------------- | ||
2281 | 46 | |||
2282 | 47 | .. automodule:: anybox.recipe.openerp.testing | ||
2283 | 48 | :members: | ||
2284 | 49 | :undoc-members: | ||
2285 | 50 | :show-inheritance: | ||
2286 | 51 | |||
2287 | 52 | :mod:`utils` Module | ||
2288 | 53 | ------------------- | ||
2289 | 54 | |||
2290 | 55 | .. automodule:: anybox.recipe.openerp.utils | ||
2291 | 56 | :members: | ||
2292 | 57 | :undoc-members: | ||
2293 | 58 | :show-inheritance: | ||
2294 | 59 | |||
2295 | 60 | :mod:`webclient` Module | ||
2296 | 61 | ----------------------- | ||
2297 | 62 | |||
2298 | 63 | .. automodule:: anybox.recipe.openerp.webclient | ||
2299 | 64 | :members: | ||
2300 | 65 | :undoc-members: | ||
2301 | 66 | :show-inheritance: | ||
2302 | 67 | |||
2303 | 68 | Subpackages | ||
2304 | 69 | ----------- | ||
2305 | 70 | |||
2306 | 71 | .. toctree:: | ||
2307 | 72 | |||
2308 | 73 | anybox.recipe.openerp.runtime | ||
2309 | 74 | anybox.recipe.openerp.vcs | ||
2310 | 75 | |||
2311 | 0 | 76 | ||
2312 | === added file 'doc/apidoc/anybox.recipe.openerp.runtime.rst' | |||
2313 | --- doc/apidoc/anybox.recipe.openerp.runtime.rst 1970-01-01 00:00:00 +0000 | |||
2314 | +++ doc/apidoc/anybox.recipe.openerp.runtime.rst 2014-02-06 07:42:46 +0000 | |||
2315 | @@ -0,0 +1,50 @@ | |||
2316 | 1 | runtime Subpackage | ||
2317 | 2 | ================== | ||
2318 | 3 | |||
2319 | 4 | :mod:`runtime` Package | ||
2320 | 5 | ---------------------- | ||
2321 | 6 | |||
2322 | 7 | .. automodule:: anybox.recipe.openerp.runtime | ||
2323 | 8 | :members: | ||
2324 | 9 | :undoc-members: | ||
2325 | 10 | :show-inheritance: | ||
2326 | 11 | |||
2327 | 12 | :mod:`session` Module | ||
2328 | 13 | --------------------- | ||
2329 | 14 | |||
2330 | 15 | .. automodule:: anybox.recipe.openerp.runtime.session | ||
2331 | 16 | :members: | ||
2332 | 17 | :undoc-members: | ||
2333 | 18 | :show-inheritance: | ||
2334 | 19 | |||
2335 | 20 | :mod:`upgrade` Module | ||
2336 | 21 | --------------------- | ||
2337 | 22 | |||
2338 | 23 | .. automodule:: anybox.recipe.openerp.runtime.upgrade | ||
2339 | 24 | :members: | ||
2340 | 25 | :undoc-members: | ||
2341 | 26 | :show-inheritance: | ||
2342 | 27 | |||
2343 | 28 | :mod:`patch_openerp_v5` Module | ||
2344 | 29 | ------------------------------ | ||
2345 | 30 | |||
2346 | 31 | .. automodule:: anybox.recipe.openerp.runtime.patch_openerp_v5 | ||
2347 | 32 | :members: | ||
2348 | 33 | :undoc-members: | ||
2349 | 34 | :show-inheritance: | ||
2350 | 35 | |||
2351 | 36 | :mod:`start_openerp` Module | ||
2352 | 37 | --------------------------- | ||
2353 | 38 | |||
2354 | 39 | .. automodule:: anybox.recipe.openerp.runtime.start_openerp | ||
2355 | 40 | :members: | ||
2356 | 41 | :undoc-members: | ||
2357 | 42 | :show-inheritance: | ||
2358 | 43 | |||
2359 | 44 | :mod:`test_openerp` Module | ||
2360 | 45 | -------------------------- | ||
2361 | 46 | |||
2362 | 47 | .. automodule:: anybox.recipe.openerp.runtime.test_openerp | ||
2363 | 48 | :members: | ||
2364 | 49 | :undoc-members: | ||
2365 | 50 | :show-inheritance: | ||
2366 | 0 | 51 | ||
2367 | === added file 'doc/apidoc/anybox.recipe.openerp.vcs.rst' | |||
2368 | --- doc/apidoc/anybox.recipe.openerp.vcs.rst 1970-01-01 00:00:00 +0000 | |||
2369 | +++ doc/apidoc/anybox.recipe.openerp.vcs.rst 2014-02-06 07:42:46 +0000 | |||
2370 | @@ -0,0 +1,59 @@ | |||
2371 | 1 | vcs Subpackage | ||
2372 | 2 | ============== | ||
2373 | 3 | |||
2374 | 4 | :mod:`vcs` Package | ||
2375 | 5 | ------------------ | ||
2376 | 6 | |||
2377 | 7 | .. automodule:: anybox.recipe.openerp.vcs | ||
2378 | 8 | :members: | ||
2379 | 9 | :undoc-members: | ||
2380 | 10 | :show-inheritance: | ||
2381 | 11 | |||
2382 | 12 | :mod:`base` Module | ||
2383 | 13 | ------------------ | ||
2384 | 14 | |||
2385 | 15 | .. automodule:: anybox.recipe.openerp.vcs.base | ||
2386 | 16 | :members: | ||
2387 | 17 | :undoc-members: | ||
2388 | 18 | :show-inheritance: | ||
2389 | 19 | |||
2390 | 20 | :mod:`bzr` Module | ||
2391 | 21 | ----------------- | ||
2392 | 22 | |||
2393 | 23 | .. automodule:: anybox.recipe.openerp.vcs.bzr | ||
2394 | 24 | :members: | ||
2395 | 25 | :undoc-members: | ||
2396 | 26 | :show-inheritance: | ||
2397 | 27 | |||
2398 | 28 | :mod:`git` Module | ||
2399 | 29 | ----------------- | ||
2400 | 30 | |||
2401 | 31 | .. automodule:: anybox.recipe.openerp.vcs.git | ||
2402 | 32 | :members: | ||
2403 | 33 | :undoc-members: | ||
2404 | 34 | :show-inheritance: | ||
2405 | 35 | |||
2406 | 36 | :mod:`hg` Module | ||
2407 | 37 | ---------------- | ||
2408 | 38 | |||
2409 | 39 | .. automodule:: anybox.recipe.openerp.vcs.hg | ||
2410 | 40 | :members: | ||
2411 | 41 | :undoc-members: | ||
2412 | 42 | :show-inheritance: | ||
2413 | 43 | |||
2414 | 44 | :mod:`svn` Module | ||
2415 | 45 | ----------------- | ||
2416 | 46 | |||
2417 | 47 | .. automodule:: anybox.recipe.openerp.vcs.svn | ||
2418 | 48 | :members: | ||
2419 | 49 | :undoc-members: | ||
2420 | 50 | :show-inheritance: | ||
2421 | 51 | |||
2422 | 52 | :mod:`testing` Module | ||
2423 | 53 | --------------------- | ||
2424 | 54 | |||
2425 | 55 | .. automodule:: anybox.recipe.openerp.vcs.testing | ||
2426 | 56 | :members: | ||
2427 | 57 | :undoc-members: | ||
2428 | 58 | :show-inheritance: | ||
2429 | 59 | |||
2430 | 0 | 60 | ||
2431 | === added file 'doc/conf.py' | |||
2432 | --- doc/conf.py 1970-01-01 00:00:00 +0000 | |||
2433 | +++ doc/conf.py 2014-02-06 07:42:46 +0000 | |||
2434 | @@ -0,0 +1,247 @@ | |||
2435 | 1 | # -*- coding: utf-8 -*- | ||
2436 | 2 | # | ||
2437 | 3 | # OpenERP buildout recipe documentation build configuration file, created by | ||
2438 | 4 | # sphinx-quickstart on Wed Jul 24 18:32:19 2013. | ||
2439 | 5 | # | ||
2440 | 6 | # This file is execfile()d with the current directory set to its containing dir. | ||
2441 | 7 | # | ||
2442 | 8 | # Note that not all possible configuration values are present in this | ||
2443 | 9 | # autogenerated file. | ||
2444 | 10 | # | ||
2445 | 11 | # All configuration values have a default; values that are commented out | ||
2446 | 12 | # serve to show the default. | ||
2447 | 13 | |||
2448 | 14 | import sys, os | ||
2449 | 15 | |||
2450 | 16 | # If extensions (or modules to document with autodoc) are in another directory, | ||
2451 | 17 | # add these directories to sys.path here. If the directory is relative to the | ||
2452 | 18 | # documentation root, use os.path.abspath to make it absolute, like shown here. | ||
2453 | 19 | sys.path.insert(0, os.path.abspath('..')) | ||
2454 | 20 | # -- General configuration ----------------------------------------------------- | ||
2455 | 21 | |||
2456 | 22 | # If your documentation needs a minimal Sphinx version, state it here. | ||
2457 | 23 | #needs_sphinx = '1.0' | ||
2458 | 24 | |||
2459 | 25 | # Add any Sphinx extension module names here, as strings. They can be extensions | ||
2460 | 26 | # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. | ||
2461 | 27 | extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.todo', 'sphinx.ext.viewcode'] | ||
2462 | 28 | |||
2463 | 29 | # Add any paths that contain templates here, relative to this directory. | ||
2464 | 30 | templates_path = ['sphinx_templates'] | ||
2465 | 31 | |||
2466 | 32 | # The suffix of source filenames. | ||
2467 | 33 | source_suffix = '.rst' | ||
2468 | 34 | |||
2469 | 35 | # The encoding of source files. | ||
2470 | 36 | #source_encoding = 'utf-8-sig' | ||
2471 | 37 | |||
2472 | 38 | # The master toctree document. | ||
2473 | 39 | master_doc = 'index' | ||
2474 | 40 | |||
2475 | 41 | # General information about the project. | ||
2476 | 42 | project = u'OpenERP buildout recipe' | ||
2477 | 43 | copyright = u'2011-2013, Anybox SAS' | ||
2478 | 44 | |||
2479 | 45 | # The version info for the project you're documenting, acts as replacement for | ||
2480 | 46 | # |version| and |release|, also used in various other places throughout the | ||
2481 | 47 | # built documents. | ||
2482 | 48 | # | ||
2483 | 49 | # The short X.Y version. | ||
2484 | 50 | version = '1.8' | ||
2485 | 51 | # The full version, including alpha/beta/rc tags. | ||
2486 | 52 | release = '1.8.2-dev' | ||
2487 | 53 | |||
2488 | 54 | # The language for content autogenerated by Sphinx. Refer to documentation | ||
2489 | 55 | # for a list of supported languages. | ||
2490 | 56 | #language = None | ||
2491 | 57 | |||
2492 | 58 | # There are two options for replacing |today|: either, you set today to some | ||
2493 | 59 | # non-false value, then it is used: | ||
2494 | 60 | #today = '' | ||
2495 | 61 | # Else, today_fmt is used as the format for a strftime call. | ||
2496 | 62 | #today_fmt = '%B %d, %Y' | ||
2497 | 63 | |||
2498 | 64 | # List of patterns, relative to source directory, that match files and | ||
2499 | 65 | # directories to ignore when looking for source files. | ||
2500 | 66 | exclude_patterns = ['sphinx_build'] | ||
2501 | 67 | |||
2502 | 68 | # The reST default role (used for this markup: `text`) to use for all documents. | ||
2503 | 69 | #default_role = None | ||
2504 | 70 | |||
2505 | 71 | # If true, '()' will be appended to :func: etc. cross-reference text. | ||
2506 | 72 | #add_function_parentheses = True | ||
2507 | 73 | |||
2508 | 74 | # If true, the current module name will be prepended to all description | ||
2509 | 75 | # unit titles (such as .. function::). | ||
2510 | 76 | add_module_names = True | ||
2511 | 77 | |||
2512 | 78 | # If true, sectionauthor and moduleauthor directives will be shown in the | ||
2513 | 79 | # output. They are ignored by default. | ||
2514 | 80 | #show_authors = False | ||
2515 | 81 | |||
2516 | 82 | # The name of the Pygments (syntax highlighting) style to use. | ||
2517 | 83 | pygments_style = 'sphinx' | ||
2518 | 84 | |||
2519 | 85 | # A list of ignored prefixes for module index sorting. | ||
2520 | 86 | modindex_common_prefix = ['anybox.recipe.openerp.'] | ||
2521 | 87 | |||
2522 | 88 | # If true, keep warnings as "system message" paragraphs in the built documents. | ||
2523 | 89 | #keep_warnings = False | ||
2524 | 90 | |||
2525 | 91 | |||
2526 | 92 | # -- Options for HTML output --------------------------------------------------- | ||
2527 | 93 | |||
2528 | 94 | # The theme to use for HTML and HTML Help pages. See the documentation for | ||
2529 | 95 | # a list of builtin themes. | ||
2530 | 96 | html_theme = 'default' | ||
2531 | 97 | |||
2532 | 98 | # Theme options are theme-specific and customize the look and feel of a theme | ||
2533 | 99 | # further. For a list of options available for each theme, see the | ||
2534 | 100 | # documentation. | ||
2535 | 101 | #html_theme_options = {} | ||
2536 | 102 | |||
2537 | 103 | # Add any paths that contain custom themes here, relative to this directory. | ||
2538 | 104 | #html_theme_path = [] | ||
2539 | 105 | |||
2540 | 106 | # The name for this set of Sphinx documents. If None, it defaults to | ||
2541 | 107 | # "<project> v<release> documentation". | ||
2542 | 108 | #html_title = None | ||
2543 | 109 | |||
2544 | 110 | # A shorter title for the navigation bar. Default is the same as html_title. | ||
2545 | 111 | #html_short_title = None | ||
2546 | 112 | |||
2547 | 113 | # The name of an image file (relative to this directory) to place at the top | ||
2548 | 114 | # of the sidebar. | ||
2549 | 115 | html_logo = 'sphinx_templates/logo.png' | ||
2550 | 116 | |||
2551 | 117 | # The name of an image file (within the static path) to use as favicon of the | ||
2552 | 118 | # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 | ||
2553 | 119 | # pixels large. | ||
2554 | 120 | html_favicon = 'sphinx_templates/favicon.ico' | ||
2555 | 121 | |||
2556 | 122 | # Add any paths that contain custom static files (such as style sheets) here, | ||
2557 | 123 | # relative to this directory. They are copied after the builtin static files, | ||
2558 | 124 | # so a file named "default.css" will overwrite the builtin "default.css". | ||
2559 | 125 | html_static_path = ['sphinx_static'] | ||
2560 | 126 | |||
2561 | 127 | # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, | ||
2562 | 128 | # using the given strftime format. | ||
2563 | 129 | #html_last_updated_fmt = '%b %d, %Y' | ||
2564 | 130 | |||
2565 | 131 | # If true, SmartyPants will be used to convert quotes and dashes to | ||
2566 | 132 | # typographically correct entities. | ||
2567 | 133 | #html_use_smartypants = True | ||
2568 | 134 | |||
2569 | 135 | # Custom sidebar templates, maps document names to template names. | ||
2570 | 136 | #html_sidebars = {} | ||
2571 | 137 | |||
2572 | 138 | # Additional templates that should be rendered to pages, maps page names to | ||
2573 | 139 | # template names. | ||
2574 | 140 | #html_additional_pages = {} | ||
2575 | 141 | |||
2576 | 142 | # If false, no module index is generated. | ||
2577 | 143 | #html_domain_indices = True | ||
2578 | 144 | |||
2579 | 145 | # If false, no index is generated. | ||
2580 | 146 | #html_use_index = True | ||
2581 | 147 | |||
2582 | 148 | # If true, the index is split into individual pages for each letter. | ||
2583 | 149 | #html_split_index = False | ||
2584 | 150 | |||
2585 | 151 | # If true, links to the reST sources are added to the pages. | ||
2586 | 152 | #html_show_sourcelink = True | ||
2587 | 153 | |||
2588 | 154 | # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. | ||
2589 | 155 | #html_show_sphinx = True | ||
2590 | 156 | |||
2591 | 157 | # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. | ||
2592 | 158 | #html_show_copyright = True | ||
2593 | 159 | |||
2594 | 160 | # If true, an OpenSearch description file will be output, and all pages will | ||
2595 | 161 | # contain a <link> tag referring to it. The value of this option must be the | ||
2596 | 162 | # base URL from which the finished HTML is served. | ||
2597 | 163 | #html_use_opensearch = '' | ||
2598 | 164 | |||
2599 | 165 | # This is the file name suffix for HTML files (e.g. ".xhtml"). | ||
2600 | 166 | #html_file_suffix = None | ||
2601 | 167 | |||
2602 | 168 | # Output file base name for HTML help builder. | ||
2603 | 169 | htmlhelp_basename = 'OpenERPbuildoutrecipedoc' | ||
2604 | 170 | |||
2605 | 171 | |||
2606 | 172 | # -- Options for LaTeX output -------------------------------------------------- | ||
2607 | 173 | |||
2608 | 174 | latex_elements = { | ||
2609 | 175 | # The paper size ('letterpaper' or 'a4paper'). | ||
2610 | 176 | #'papersize': 'letterpaper', | ||
2611 | 177 | |||
2612 | 178 | # The font size ('10pt', '11pt' or '12pt'). | ||
2613 | 179 | #'pointsize': '10pt', | ||
2614 | 180 | |||
2615 | 181 | # Additional stuff for the LaTeX preamble. | ||
2616 | 182 | #'preamble': '', | ||
2617 | 183 | } | ||
2618 | 184 | |||
2619 | 185 | # Grouping the document tree into LaTeX files. List of tuples | ||
2620 | 186 | # (source start file, target name, title, author, documentclass [howto/manual]). | ||
2621 | 187 | latex_documents = [ | ||
2622 | 188 | ('index', 'OpenERPbuildoutrecipe.tex', u'OpenERP buildout recipe Documentation', | ||
2623 | 189 | u'Christophe Combelles, Georges Racinet', 'manual'), | ||
2624 | 190 | ] | ||
2625 | 191 | |||
2626 | 192 | # The name of an image file (relative to this directory) to place at the top of | ||
2627 | 193 | # the title page. | ||
2628 | 194 | #latex_logo = None | ||
2629 | 195 | |||
2630 | 196 | # For "manual" documents, if this is true, then toplevel headings are parts, | ||
2631 | 197 | # not chapters. | ||
2632 | 198 | #latex_use_parts = False | ||
2633 | 199 | |||
2634 | 200 | # If true, show page references after internal links. | ||
2635 | 201 | #latex_show_pagerefs = False | ||
2636 | 202 | |||
2637 | 203 | # If true, show URL addresses after external links. | ||
2638 | 204 | #latex_show_urls = False | ||
2639 | 205 | |||
2640 | 206 | # Documents to append as an appendix to all manuals. | ||
2641 | 207 | #latex_appendices = [] | ||
2642 | 208 | |||
2643 | 209 | # If false, no module index is generated. | ||
2644 | 210 | #latex_domain_indices = True | ||
2645 | 211 | |||
2646 | 212 | |||
2647 | 213 | # -- Options for manual page output -------------------------------------------- | ||
2648 | 214 | |||
2649 | 215 | # One entry per manual page. List of tuples | ||
2650 | 216 | # (source start file, name, description, authors, manual section). | ||
2651 | 217 | man_pages = [ | ||
2652 | 218 | ('index', 'openerpbuildoutrecipe', u'OpenERP buildout recipe Documentation', | ||
2653 | 219 | [u'Christophe Combelles, Georges Racinet'], 1) | ||
2654 | 220 | ] | ||
2655 | 221 | |||
2656 | 222 | # If true, show URL addresses after external links. | ||
2657 | 223 | #man_show_urls = False | ||
2658 | 224 | |||
2659 | 225 | |||
2660 | 226 | # -- Options for Texinfo output ------------------------------------------------ | ||
2661 | 227 | |||
2662 | 228 | # Grouping the document tree into Texinfo files. List of tuples | ||
2663 | 229 | # (source start file, target name, title, author, | ||
2664 | 230 | # dir menu entry, description, category) | ||
2665 | 231 | texinfo_documents = [ | ||
2666 | 232 | ('index', 'OpenERPbuildoutrecipe', u'OpenERP buildout recipe Documentation', | ||
2667 | 233 | u'Christophe Combelles, Georges Racinet', 'OpenERPbuildoutrecipe', 'One line description of project.', | ||
2668 | 234 | 'Miscellaneous'), | ||
2669 | 235 | ] | ||
2670 | 236 | |||
2671 | 237 | # Documents to append as an appendix to all manuals. | ||
2672 | 238 | #texinfo_appendices = [] | ||
2673 | 239 | |||
2674 | 240 | # If false, no module index is generated. | ||
2675 | 241 | #texinfo_domain_indices = True | ||
2676 | 242 | |||
2677 | 243 | # How to display URL addresses: 'footnote', 'no', or 'inline'. | ||
2678 | 244 | #texinfo_show_urls = 'footnote' | ||
2679 | 245 | |||
2680 | 246 | # If true, do not generate a @detailmenu in the "Top" node's menu. | ||
2681 | 247 | #texinfo_no_detailmenu = False | ||
2682 | 0 | 248 | ||
2683 | === renamed file 'README.rst' => 'doc/configuration.rst' | |||
2684 | --- README.rst 2013-09-07 11:43:18 +0000 | |||
2685 | +++ doc/configuration.rst 2014-02-06 07:42:46 +0000 | |||
2686 | @@ -1,5 +1,5 @@ | |||
2689 | 1 | anybox.recipe.openerp | 1 | Configuration reference |
2690 | 2 | ===================== | 2 | ======================= |
2691 | 3 | 3 | ||
2692 | 4 | This is a `Buildout <https://github.com/buildout/buildout>`_ recipe that can | 4 | This is a `Buildout <https://github.com/buildout/buildout>`_ recipe that can |
2693 | 5 | download, install and configure one or several OpenERP servers, web clients, | 5 | download, install and configure one or several OpenERP servers, web clients, |
2694 | @@ -8,8 +8,6 @@ | |||
2695 | 8 | with gunicorn deployment and an additional cron worker. It works under Linux | 8 | with gunicorn deployment and an additional cron worker. It works under Linux |
2696 | 9 | and MacOs. It might work under Windows but it is untested. | 9 | and MacOs. It might work under Windows but it is untested. |
2697 | 10 | 10 | ||
2698 | 11 | For a **quickstart** you can jump to the howto_ section. | ||
2699 | 12 | |||
2700 | 13 | A "Buildout recipe" is the engine behind a Buildout "part". A "buildout part" | 11 | A "Buildout recipe" is the engine behind a Buildout "part". A "buildout part" |
2701 | 14 | is a part of a larger application built with the Buildout sandbox build system. | 12 | is a part of a larger application built with the Buildout sandbox build system. |
2702 | 15 | Using Buildout is harmless for your system because it is entirely | 13 | Using Buildout is harmless for your system because it is entirely |
2703 | @@ -17,120 +15,167 @@ | |||
2704 | 17 | buildout is gone. You never have to use administrative rights, except for | 15 | buildout is gone. You never have to use administrative rights, except for |
2705 | 18 | build dependencies. | 16 | build dependencies. |
2706 | 19 | 17 | ||
2715 | 20 | .. contents:: | 18 | .. _buildout_conf_parts: |
2716 | 21 | 19 | ||
2717 | 22 | Recipes | 20 | The buildout configuration file and parts |
2718 | 23 | ~~~~~~~ | 21 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
2719 | 24 | 22 | The intents of this section is to highlights a few facts that we've | |
2720 | 25 | You get 3 recipes at once. The recipe to use is the following: | 23 | found especially useful. People should refer to the |
2721 | 26 | 24 | `reference zc.buildout documentation | |
2722 | 27 | For the server:: | 25 | <https://pypi.python.org/pypi/zc.buildout/2.2.1>`_ |
2723 | 26 | and in particular to the `configuration file syntax | ||
2724 | 27 | <https://pypi.python.org/pypi/zc.buildout/2.2.1#configuration-file-syntax>`_ | ||
2725 | 28 | (these links may have to be adapted for the version in use). | ||
2726 | 29 | |||
2727 | 30 | |||
2728 | 31 | Buildout configuration files are written almost in INI format, and | ||
2729 | 32 | always start with a ``buildout`` section:: | ||
2730 | 33 | |||
2731 | 34 | [buildout] | ||
2732 | 35 | parts = openerp | ||
2733 | 36 | |||
2734 | 37 | The ``parts`` option specifies which parts to install by default if | ||
2735 | 38 | one runs ``bin/buildout`` with no explicit ``install`` directive. | ||
2736 | 39 | |||
2737 | 40 | Parts directly correspond to sections of the configuration file, and | ||
2738 | 41 | must specify the recipe that's to be used:: | ||
2739 | 42 | |||
2740 | 43 | [openerp] | ||
2741 | 44 | recipe = anybox.recipe.openerp:server | ||
2742 | 45 | |||
2743 | 46 | An extra dependency of the recipe gets required at runtime like this:: | ||
2744 | 47 | |||
2745 | 48 | recipe = anybox.recipe.openerp[bzr]:server | ||
2746 | 49 | |||
2747 | 50 | Command line | ||
2748 | 51 | ------------ | ||
2749 | 52 | The configuration file can be specified from the command line:: | ||
2750 | 53 | |||
2751 | 54 | bin/buildout -c buildout.local.cfg | ||
2752 | 55 | |||
2753 | 56 | Recipe options can be overridden from the command-line:: | ||
2754 | 57 | |||
2755 | 58 | bin/buildout -c buildout.local.cfg openerp:clean=True openerp:xmlrpc_port=8169 | ||
2756 | 59 | |||
2757 | 60 | Parts that are not listed in the ``buildout`` configuration section | ||
2758 | 61 | can be explicitely installed:: | ||
2759 | 62 | |||
2760 | 63 | bin/buildout install openerp funkload static-analysis | ||
2761 | 64 | |||
2762 | 65 | .. _extends: | ||
2763 | 66 | |||
2764 | 67 | Inheritance | ||
2765 | 68 | ----------- | ||
2766 | 69 | |||
2767 | 70 | A buildout configuration file can reference another one and change | ||
2768 | 71 | some options (note the ``+=`` notation that's not part of the INI format):: | ||
2769 | 72 | |||
2770 | 73 | [buildout] | ||
2771 | 74 | extends = buildout.base.cfg | ||
2772 | 75 | |||
2773 | 76 | [openerp] | ||
2774 | 77 | eggs += nose | ||
2775 | 78 | coverage | ||
2776 | 79 | with_devtools = True | ||
2777 | 80 | |||
2778 | 81 | These extensions can be chained. This allows in particular project maintainers | ||
2779 | 82 | to separate the configuration options that are considered to be part | ||
2780 | 83 | of the project from those that depend on the server environment | ||
2781 | 84 | (ports, database hosts…) | ||
2782 | 85 | |||
2783 | 86 | Default configuration | ||
2784 | 87 | --------------------- | ||
2785 | 88 | |||
2786 | 89 | If available, the settings from ``$HOME/.buildout/default.cfg`` always | ||
2787 | 90 | apply, as if it where the default value of the :ref:`extends <extends>` option. | ||
2788 | 91 | |||
2789 | 92 | This is commonly used with the ``eggs-directory`` and | ||
2790 | 93 | :ref:`openerp-downloads-directory` options, because these amount to create a | ||
2791 | 94 | user-level cache. | ||
2792 | 95 | |||
2793 | 96 | Finally, you may also use :ref:`extends <extends>` in ``default.cfg`` to point | ||
2794 | 97 | to a system-wide configuration file (useful to enforce | ||
2795 | 98 | policies at the organization or physical site level, such as local | ||
2796 | 99 | index servers, mirrors, etc.). | ||
2797 | 100 | |||
2798 | 101 | |||
2799 | 102 | OpenERP recipes | ||
2800 | 103 | ~~~~~~~~~~~~~~~ | ||
2801 | 104 | |||
2802 | 105 | There are three different recipes bundled with | ||
2803 | 106 | ``anybox.recipe.openerp``. The option line to put in your part (see | ||
2804 | 107 | :ref:`buildout_conf_parts`) is the following. | ||
2805 | 108 | |||
2806 | 109 | Server | ||
2807 | 110 | ------ | ||
2808 | 111 | :: | ||
2809 | 28 | 112 | ||
2810 | 29 | recipe = anybox.recipe.openerp:server | 113 | recipe = anybox.recipe.openerp:server |
2811 | 30 | 114 | ||
2813 | 31 | For the web client:: | 115 | .. note:: If you plan on using Launchpad's short Bazaar branch notation |
2814 | 116 | (``lp:``), then you need to add the ``bzr`` extra-dependency:: | ||
2815 | 117 | |||
2816 | 118 | recipe = anybox.recipe.openerp[bzr]:server | ||
2817 | 119 | |||
2818 | 120 | Web client | ||
2819 | 121 | ---------- | ||
2820 | 122 | :: | ||
2821 | 32 | 123 | ||
2822 | 33 | recipe = anybox.recipe.openerp:webclient | 124 | recipe = anybox.recipe.openerp:webclient |
2823 | 34 | 125 | ||
2825 | 35 | For the gtk client:: | 126 | GTK client |
2826 | 127 | ---------- | ||
2827 | 128 | :: | ||
2828 | 36 | 129 | ||
2829 | 37 | recipe = anybox.recipe.openerp:gtkclient | 130 | recipe = anybox.recipe.openerp:gtkclient |
2830 | 38 | 131 | ||
2891 | 39 | Default options from zc.recipe.egg | 132 | .. note:: from OpenERP 7.0 onwards, the web and gtk clients aren't |
2892 | 40 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 133 | that useful anymore. |
2893 | 41 | 134 | ||
2894 | 42 | This recipe reuses the *zc.recipe.egg:scripts* recipe, so the options | 135 | Options for assembly and source management |
2895 | 43 | are the same (*eggs*, *interpreter*, etc.), and some changes, documented below. | 136 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
2896 | 44 | 137 | ||
2897 | 45 | Consult the documentation here http://pypi.python.org/pypi/zc.recipe.egg | 138 | .. _version: |
2838 | 46 | |||
2839 | 47 | The main useful ones are below: | ||
2840 | 48 | |||
2841 | 49 | eggs | ||
2842 | 50 | ---- | ||
2843 | 51 | |||
2844 | 52 | Starting from version 0.16 of the recipe, you don't need to put anything in | ||
2845 | 53 | this option by default. But you may specify additional eggs needed by addons, | ||
2846 | 54 | or just useful ones:: | ||
2847 | 55 | |||
2848 | 56 | eggs = | ||
2849 | 57 | ipython | ||
2850 | 58 | openobject-library | ||
2851 | 59 | |||
2852 | 60 | scripts | ||
2853 | 61 | ------- | ||
2854 | 62 | .. note:: for scripts needing to call OpenERP internal API or to load | ||
2855 | 63 | an OpenERP database prior to execution, check | ||
2856 | 64 | ``openerp_scripts`` below. | ||
2857 | 65 | |||
2858 | 66 | The behaviour of this option is slightly modified : | ||
2859 | 67 | by default, no script other than those directly related to OpenERP are | ||
2860 | 68 | generated, but you may specify some explicitely, with the same semantics as the | ||
2861 | 69 | normal behaviour (we simply set an empty default value, which means to not | ||
2862 | 70 | produce scripts):: | ||
2863 | 71 | |||
2864 | 72 | scripts = | ||
2865 | 73 | change_tz | ||
2866 | 74 | |||
2867 | 75 | In the current state, beware to *not* require the same script in different | ||
2868 | 76 | parts or rename them. See | ||
2869 | 77 | https://bugs.launchpad.net/anybox.recipe.openerp/+bug/1020967 for | ||
2870 | 78 | details. | ||
2871 | 79 | |||
2872 | 80 | interpreter | ||
2873 | 81 | ----------- | ||
2874 | 82 | With the ``gtklcient`` and ``webclient`` recipes, | ||
2875 | 83 | this is the default `interpreter` option of `zc.recipe.egg` that | ||
2876 | 84 | specifies the name of the Python interpreter that shoud be included in | ||
2877 | 85 | the``bin`` directory of the buildout:: | ||
2878 | 86 | |||
2879 | 87 | interpreter = erp_python | ||
2880 | 88 | |||
2881 | 89 | With the ``server`` recipe, the ``interpreter`` option will be ignored, | ||
2882 | 90 | because it always creates an interpreter with preloaded objects to | ||
2883 | 91 | bootstrap openerp. Check the ``interpreter_name`` option below for | ||
2884 | 92 | more details. | ||
2885 | 93 | |||
2886 | 94 | |||
2887 | 95 | Specific options | ||
2888 | 96 | ~~~~~~~~~~~~~~~~ | ||
2889 | 97 | |||
2890 | 98 | The recipe also adds a few specific options: | ||
2898 | 99 | 139 | ||
2899 | 100 | version | 140 | version |
2900 | 101 | ------- | 141 | ------- |
2901 | 102 | 142 | ||
2902 | 103 | Specifies the OpenERP version to use. It can be: | 143 | Specifies the OpenERP version to use. It can be: |
2903 | 104 | 144 | ||
2933 | 105 | The **version number** of an official OpenERP (server, web client or gtk client):: | 145 | * The **version number** of an official OpenERP (server, web client or gtk client):: |
2934 | 106 | 146 | ||
2935 | 107 | version = 6.0.3 | 147 | version = 6.0.3 |
2936 | 108 | 148 | ||
2937 | 109 | A **custom download**:: | 149 | * A **custom download**:: |
2938 | 110 | 150 | ||
2939 | 111 | version = url http://example.com/openerp.tar.gz | 151 | version = url http://example.com/openerp.tar.gz |
2940 | 112 | 152 | ||
2941 | 113 | An absolute or a relative **path**:: | 153 | * An absolute or a relative **path**:: |
2942 | 114 | 154 | ||
2943 | 115 | version = path /my/path/to/a/custom/openerp | 155 | version = path /my/path/to/a/custom/openerp |
2944 | 116 | 156 | ||
2945 | 117 | A custom **bzr, hg, git or svn** branch or repository. The syntax is the same | 157 | * A custom **bzr, hg, git or svn** branch or repository. The syntax is the same |
2946 | 118 | as the `addons` option (see below):: | 158 | as with the :ref:`addons` option:: |
2947 | 119 | 159 | ||
2948 | 120 | version = bzr lp:openobject-server/6.1 openerp61 last:1 | 160 | recipe = anybox.recipe.openerp[bzr]:server |
2949 | 121 | 161 | version = bzr lp:openobject-server/6.1 openerp61 last:1 | |
2950 | 122 | A **nightly** build:: | 162 | |
2951 | 123 | 163 | .. note:: the ``[bzr]`` extra dependency declaration is useful for | |
2952 | 124 | version = nightly 6.1 20120814-233345 | 164 | resolution of the ``lp:`` address shortcuts. |
2953 | 125 | 165 | ||
2954 | 126 | or (dangerously unpinned version):: | 166 | * A **nightly** build:: |
2955 | 127 | 167 | ||
2956 | 128 | version = nightly 6.1 latest | 168 | version = nightly 6.1 20120814-233345 |
2957 | 129 | 169 | ||
2958 | 130 | or even more dangerous:: | 170 | * or (dangerously unpinned version):: |
2959 | 131 | 171 | ||
2960 | 132 | version = nightly trunk latest | 172 | version = nightly 6.1 latest |
2961 | 133 | 173 | ||
2962 | 174 | * or even more dangerous:: | ||
2963 | 175 | |||
2964 | 176 | version = nightly trunk latest | ||
2965 | 177 | |||
2966 | 178 | .. _addons: | ||
2967 | 134 | 179 | ||
2968 | 135 | addons | 180 | addons |
2969 | 136 | ------ | 181 | ------ |
2970 | @@ -139,6 +184,7 @@ | |||
2971 | 139 | 184 | ||
2972 | 140 | Example:: | 185 | Example:: |
2973 | 141 | 186 | ||
2974 | 187 | recipe = anybox.recipe.openerp[bzr]:server | ||
2975 | 142 | addons = local ../some/relative/path/for/custom_addons/ | 188 | addons = local ../some/relative/path/for/custom_addons/ |
2976 | 143 | local /some/other/absolute/path/for/custom_addons | 189 | local /some/other/absolute/path/for/custom_addons |
2977 | 144 | bzr lp:openobject-addons/trunk/ addons0 last:1 | 190 | bzr lp:openobject-addons/trunk/ addons0 last:1 |
2978 | @@ -151,6 +197,10 @@ | |||
2979 | 151 | addons, or a single addon. In that latter case, it will be actually | 197 | addons, or a single addon. In that latter case, it will be actually |
2980 | 152 | placed one directory below. | 198 | placed one directory below. |
2981 | 153 | 199 | ||
2982 | 200 | .. note:: the ``[bzr]`` extra-dependency declaration as showcased | ||
2983 | 201 | above in the ``recipe`` line is necessary for | ||
2984 | 202 | resolution of ``lp:`` launchpad address shortcuts. | ||
2985 | 203 | |||
2986 | 154 | .. warning:: | 204 | .. warning:: |
2987 | 155 | 205 | ||
2988 | 156 | Never name one of these addons directory simply ``addons``. It | 206 | Never name one of these addons directory simply ``addons``. It |
2989 | @@ -159,15 +209,17 @@ | |||
2990 | 159 | 209 | ||
2991 | 160 | For remote repositories, the syntax is: | 210 | For remote repositories, the syntax is: |
2992 | 161 | 211 | ||
3002 | 162 | ``TYPE URL DESTINATION REVISION [OPTIONS]`` | 212 | ``TYPE URL DESTINATION REVISION [OPTIONS]`` |
3003 | 163 | 213 | ||
3004 | 164 | * *TYPE* can be ``bzr``, ``hg``, ``git`` or ``svn`` | 214 | with the following semantics: |
3005 | 165 | * *URL* is any URL scheme supported by the versionning tool | 215 | |
3006 | 166 | * *DESTINATION* is the local directory that will be created (relative or absolute) | 216 | :TYPE: one of ``bzr``, ``hg``, ``git`` or ``svn`` |
3007 | 167 | * *REVISION* is any version specification supported (revision, tag, etc.) | 217 | :URL: is any URL scheme supported by the versionning tool |
3008 | 168 | * *OPTIONS* take the form ``name=value``. Currently the ``subdir`` | 218 | :DESTINATION: is the local directory that will be created (relative or absolute) |
3009 | 169 | option is recognized. If used, the given subdirectory of the | 219 | :REVISION: is any version specification supported (revision, tag, etc.) |
3010 | 170 | repository is registered as an addons directory. | 220 | :OPTIONS: each one takes the form ``name=value``. No whitespace is |
3011 | 221 | allowed inside an option, and no escaping is | ||
3012 | 222 | implemented. | ||
3013 | 171 | 223 | ||
3014 | 172 | Repositories are updated on each build according to the specified | 224 | Repositories are updated on each build according to the specified |
3015 | 173 | revision. You must be careful with the revision specification. | 225 | revision. You must be careful with the revision specification. |
3016 | @@ -176,32 +228,59 @@ | |||
3017 | 176 | specified revision is performed, if the VCS allows it (Subversion does | 228 | specified revision is performed, if the VCS allows it (Subversion does |
3018 | 177 | not). | 229 | not). |
3019 | 178 | 230 | ||
3037 | 179 | .. note:: An additional option is supported for bzr. **'bzr-init'** | 231 | The ``subdir`` addons option |
3038 | 180 | defines the way the bzr branch | 232 | ```````````````````````````` |
3039 | 181 | is initialized for addons or server declared with a bzr | 233 | |
3040 | 182 | repository path. | 234 | The ``subdir`` option, if used, makes the recipe use the given |
3041 | 183 | 235 | subdirectory of the repository as the addons directory. | |
3042 | 184 | Possible values: | 236 | A very common example is the line for standard web addons from bzr:: |
3043 | 185 | 237 | ||
3044 | 186 | branch (default) | 238 | bzr lp:openerp-web/7.0 openerp-web last:1 subdir=addons |
3045 | 187 | Working copy initialized with the command | 239 | |
3046 | 188 | ``bzr branch url ...`` | 240 | The ``bzr-init`` addons option |
3047 | 189 | stacked-branch | 241 | `````````````````````````````` |
3048 | 190 | Working copy initialized with the command | 242 | **'bzr-init'** defines the way the bzr branch |
3049 | 191 | ``bzr branch --stacked url ...`` | 243 | is initialized for addons or server declared with a bzr |
3050 | 192 | 244 | repository path. | |
3051 | 193 | lightweight-checkout | 245 | |
3052 | 194 | Working copy initialized with the command | 246 | .. note:: new in version 1.7.0 |
3053 | 195 | ``bzr checkout --lightweight url ...`` | 247 | |
3054 | 248 | Possible values: | ||
3055 | 249 | |||
3056 | 250 | :branch (default): Working copy initialized with the command | ||
3057 | 251 | ``bzr branch url ...`` | ||
3058 | 252 | |||
3059 | 253 | :stacked-branch: Working copy initialized with the command | ||
3060 | 254 | ``bzr branch --stacked url ...`` | ||
3061 | 255 | :lightweight-checkout: Working copy initialized with the command | ||
3062 | 256 | ``bzr checkout --lightweight url ...`` | ||
3063 | 257 | |||
3064 | 258 | .. _eggs: | ||
3065 | 259 | |||
3066 | 260 | eggs | ||
3067 | 261 | ---- | ||
3068 | 262 | This option behaves like the identically named one of the most common | ||
3069 | 263 | `zc.recipe.egg <https://pypi.python.org/pypi/zc.recipe.egg>`_. | ||
3070 | 264 | |||
3071 | 265 | Starting from version 0.16 of the recipe, you don't need to put anything in | ||
3072 | 266 | this option by default: the recipe is supposed to add all needed | ||
3073 | 267 | dependencies for OpenERP by itself, but you have to specify additional | ||
3074 | 268 | eggs needed by addons, or just useful ones:: | ||
3075 | 269 | |||
3076 | 270 | eggs = ipython | ||
3077 | 271 | python-ldap | ||
3078 | 272 | openobject-library | ||
3079 | 273 | |||
3080 | 274 | .. _revisions: | ||
3081 | 196 | 275 | ||
3082 | 197 | revisions | 276 | revisions |
3083 | 198 | --------- | 277 | --------- |
3084 | 199 | 278 | ||
3085 | 200 | This option allows to further precise what has been specified through | 279 | This option allows to further precise what has been specified through |
3087 | 201 | the ``addons`` and ``version`` options by fixing VCS revisions. | 280 | the :ref:`addons` and :ref:`version` options by fixing VCS revisions. |
3088 | 202 | 281 | ||
3091 | 203 | The main use-case it to apply it in an extension buildout | 282 | The main use-case it to apply it in an :ref:`extension buildout |
3092 | 204 | configuration file:: | 283 | configuration file <extends>`:: |
3093 | 205 | 284 | ||
3094 | 206 | [buildout] | 285 | [buildout] |
3095 | 207 | extends = base.cfg | 286 | extends = base.cfg |
3096 | @@ -211,7 +290,7 @@ | |||
3097 | 211 | addons-openerp 7109 | 290 | addons-openerp 7109 |
3098 | 212 | 291 | ||
3099 | 213 | As you can see in that example, the first token is the target | 292 | As you can see in that example, the first token is the target |
3101 | 214 | filesystem path, as in the ``addons`` option, the second one is the | 293 | filesystem path, as in the :ref:`addons` option, the second one is the |
3102 | 215 | revision, except in the case of the main software (if VCS based), for | 294 | revision, except in the case of the main software (if VCS based), for |
3103 | 216 | which there's no filesystem path. | 295 | which there's no filesystem path. |
3104 | 217 | 296 | ||
3105 | @@ -223,278 +302,196 @@ | |||
3106 | 223 | * freezing satisfactory revisions in a release process (the recipe can | 302 | * freezing satisfactory revisions in a release process (the recipe can |
3107 | 224 | do that automatically for you, see ``freeze-to`` option below). | 303 | do that automatically for you, see ``freeze-to`` option below). |
3108 | 225 | 304 | ||
3109 | 305 | .. _clean: | ||
3110 | 306 | |||
3111 | 226 | clean | 307 | clean |
3112 | 227 | ----- | 308 | ----- |
3113 | 228 | 309 | ||
3114 | 229 | If set to true, this option will clean remove python object files from | 310 | If set to true, this option will clean remove python object files from |
3116 | 230 | the main server part and addons before any update or install. | 311 | the main server part and addons before any update or install, and |
3117 | 312 | perform relevant VCS idea of "clean, purge". | ||
3118 | 313 | |||
3119 | 314 | .. warning:: developers can lose their uncommitted work with this option. | ||
3120 | 315 | |||
3121 | 316 | This option is not meant for developer setups, rather for | ||
3122 | 317 | deployment and continuous integration. To avoid making a | ||
3123 | 318 | dedicated buildout configuration for you CI bot, just add | ||
3124 | 319 | it on the command-line. | ||
3125 | 231 | 320 | ||
3126 | 232 | Note that tarball downloads get re-extracted afresh in any case. | 321 | Note that tarball downloads get re-extracted afresh in any case. |
3127 | 233 | 322 | ||
3256 | 234 | openerp_scripts | 323 | .. _openerp_options: |
3257 | 235 | --------------- | 324 | |
3258 | 236 | 325 | OpenERP options | |
3259 | 237 | Introduction and use-cases | 326 | ~~~~~~~~~~~~~~~ |
3260 | 238 | `````````````````````````` | 327 | |
3261 | 239 | This option lets you install console scripts provided by any of the loaded eggs, | 328 | With the OpenERP buildout recipes, OpenERP options are managed |
3262 | 240 | so that they can access to OpenERP internals and load databases. | 329 | directly from the buildout file (usually |
3263 | 241 | Some interesting use-cases: | 330 | ``buildout.cfg``) from the part. |
3264 | 242 | 331 | ||
3265 | 243 | * specific batch jobs | 332 | The OpenERP configuration files are generated by OpenERP itself in the directory |
3266 | 244 | * introspection tools | 333 | specified by ``etc-directory``, which defaults to the `etc` directory under your |
3267 | 245 | * general-purposes test launchers that don't have any knowledge of | 334 | buildout directory. |
3268 | 246 | OpenERP specifics | 335 | |
3269 | 247 | * actually, the main startup scripts themselves (with a default | 336 | The settings of the OpenERP configuration files are specified using a |
3270 | 248 | configuration, of course) | 337 | dotted notation in which the fist segment is the name of the |
3271 | 249 | 338 | corresponding section of the OpenERP config file and the second is the | |
3272 | 250 | Usage | 339 | option name. |
3273 | 251 | ````` | 340 | |
3274 | 252 | This multiline option is similar to the classical ``scripts`` options | 341 | The specified options will just overwrite the existing |
3275 | 253 | of ``zc.recipe.eggs:scripts``. It lets you ask for installation of | 342 | options in the corresponding config files. You don't have to replicate all the |
3276 | 254 | console scripts provided by the various Python distribution involved | 343 | options in your section of the buildout file. If a setting or a section does |
3277 | 255 | in the buildout part (including OpenERP itself). | 344 | not natively exist in the openerp config file, it can be created from there for |
3278 | 256 | 345 | your application. | |
3279 | 257 | The built console scripts can import all the involved Python | 346 | |
3280 | 258 | distributions, and have access to a ``session`` object, to issue | 347 | For example you can specify the xmlrpc port for the server or |
3281 | 259 | OpenERP native calls (see | 348 | even an additional option that does not exist in the default config file:: |
3282 | 260 | ``interpreter_name`` option below for details on how to use it). | 349 | |
3283 | 261 | 350 | options.xmlrpc_port = 8069 | |
3284 | 262 | One has to register exactly one console script per line. | 351 | options.additional_option = "foobar" |
3285 | 263 | 352 | ||
3286 | 264 | As it is the case with ``scripts``, one actually specifies the name of the | 353 | It will end-up in the server configuration as:: |
3287 | 265 | entry point to use (we are all used to that entry point being the name | 354 | |
3288 | 266 | of the resulting script, because that's what ``setup.py install`` does). | 355 | [options] |
3289 | 267 | 356 | xmlrpc_port = 8069 | |
3290 | 268 | Suppose there is a distribution ``my.package`` with the following lines in | 357 | additional_option = "foobar" |
3291 | 269 | its ``setup.py``:: | 358 | |
3292 | 270 | 359 | For the web client you can specify the port and company url with:: | |
3293 | 271 | entry_points=""" | 360 | |
3294 | 272 | 361 | global.server.socket_port = 8080 | |
3295 | 273 | [console_scripts] | 362 | openerp-web.company.url = 'http://anybox.fr' |
3296 | 274 | my = my.package.main:run | 363 | |
3297 | 275 | """ | 364 | It will modify the corresponding web client config:: |
3298 | 276 | 365 | ||
3299 | 277 | Now the following configuration extract builds a script called | 366 | [global] |
3300 | 278 | ``my_openerp1``, that can access ``session``:: | 367 | server.socket_port = 8080 |
3301 | 279 | 368 | ||
3302 | 280 | [openerp1] | 369 | [openerp-web] |
3303 | 281 | (...) | 370 | company.url = 'http://anybox.fr' |
3304 | 282 | openerp_scripts = my | 371 | |
3305 | 283 | 372 | .. note:: Buildout :ref:`configuration inheritance <extends>` is | |
3306 | 284 | To control the script name, just do, e.g,:: | 373 | especially useful to manage the separation between a |
3307 | 285 | 374 | reusable buildout configuration and local settings. | |
3308 | 286 | [openerp1] | 375 | |
3309 | 287 | (...) | 376 | .. note:: Note that for security reasons, the superadmin password is not set by |
3310 | 288 | openerp_scripts = my=my_script | 377 | default. If you want databases to be manageable through the UI, |
3311 | 289 | 378 | you may either explicitely set that password in the buildout part | |
3312 | 290 | This will build it as ``bin/my_script``. | 379 | configuration or even set it temporarily in the |
3313 | 291 | 380 | ``etc/openerp.conf`` file. | |
3314 | 292 | Command-line options and test launchers | 381 | |
3315 | 293 | ``````````````````````````````````````` | 382 | |
3316 | 294 | 383 | Options for executables generation and serving | |
3317 | 295 | If ``my.package`` is meant to do OpenERP heavy-lifting, then surely it | 384 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
3318 | 296 | will provide a powerful command-line parsing. e.g., to let the end user chose | 385 | |
3319 | 297 | the database on which to work, etc. | 386 | .. _script_name: |
3192 | 298 | |||
3193 | 299 | Sometimes, however, the script itself has no knowledge of OpenERP at | ||
3194 | 300 | all, but still must run after a database has been fully initialized. | ||
3195 | 301 | The main use case for this is test launchers, such as | ||
3196 | 302 | `nose <https://nose.readthedocs.org/en/latest/>`_ or simply ``unit2``. | ||
3197 | 303 | For these, the recipe has a facility to rewrap the script and add some further | ||
3198 | 304 | command-line options. | ||
3199 | 305 | |||
3200 | 306 | In this example, we build ``unit2``, the launcher that comes with | ||
3201 | 307 | ``unittest2``, and wrap it to add the database option:: | ||
3202 | 308 | |||
3203 | 309 | [openerp] | ||
3204 | 310 | (...) | ||
3205 | 311 | openerp_scripts = unit2 command-line-options=-d | ||
3206 | 312 | |||
3207 | 313 | You may then run it this way:: | ||
3208 | 314 | |||
3209 | 315 | bin/unit2_openerp -d unit-tests-db -- discover some/addon | ||
3210 | 316 | |||
3211 | 317 | Notice how ``--`` is used to separate the ``-d`` or | ||
3212 | 318 | any recipe-related options from the options expected by the script itself. | ||
3213 | 319 | |||
3214 | 320 | If one wishes to run the tests with ``nose``, one has further to | ||
3215 | 321 | require it. In the following example, we also ask for the ``coverage`` | ||
3216 | 322 | package:: | ||
3217 | 323 | |||
3218 | 324 | [openerp] | ||
3219 | 325 | (...) | ||
3220 | 326 | eggs = nose | ||
3221 | 327 | coverage | ||
3222 | 328 | openerp_scripts = nosetests command-line-options=-d | ||
3223 | 329 | |||
3224 | 330 | Here's our test run with coverage and pdb post-mortem:: | ||
3225 | 331 | |||
3226 | 332 | bin/nosetests-openerp -d unit-tests-db -- --nologcapture \ | ||
3227 | 333 | --with-coverage --pdb \ | ||
3228 | 334 | some/addon/tests/test_one.py | ||
3229 | 335 | |||
3230 | 336 | Main startup scripts | ||
3231 | 337 | ```````````````````` | ||
3232 | 338 | The recipe will in all cases build OpenERP startup scripts, according to other | ||
3233 | 339 | configuration options (gunicorn, tests etc.). These are | ||
3234 | 340 | actually special cases of the scripts controlled via ``openerp_scripts``. | ||
3235 | 341 | |||
3236 | 342 | This allows you (for now) to control the names. For instance, to | ||
3237 | 343 | replace ``bin/start_openerp`` with ``bin/oerp``, just do:: | ||
3238 | 344 | |||
3239 | 345 | [openerp] | ||
3240 | 346 | (...) | ||
3241 | 347 | openerp_scripts = openerp_starter=oerp | ||
3242 | 348 | |||
3243 | 349 | Here's the list of currently available internal entry points. For | ||
3244 | 350 | these, the ``command-line-options`` modifier has no effect. | ||
3245 | 351 | |||
3246 | 352 | :openerp_starter: main OpenERP startup script (dynamically added | ||
3247 | 353 | behing the scenes by the recipe) | ||
3248 | 354 | :openerp_tester: uniform script to start OpenERP, launch all tests and | ||
3249 | 355 | exit. This can be achieved with the main startup | ||
3250 | 356 | scripts, but options differ among OpenERP versions. | ||
3251 | 357 | (also dynamically added behind the scenes). | ||
3252 | 358 | :openerp_cron_worker: entry point for the cron worker script that gets | ||
3253 | 359 | built for gunicorn setups. | ||
3254 | 360 | :oe: entry point declared by ``openerp-command`` and used by the recipe. | ||
3255 | 361 | :gunicorn: entry point declared by ``gunicorn`` and used by the recipe. | ||
3320 | 362 | 387 | ||
3321 | 363 | script_name | 388 | script_name |
3322 | 364 | ----------- | 389 | ----------- |
3323 | 365 | 390 | ||
3324 | 366 | .. warning:: as of version 1.7.0, this option is deprecated because of its | 391 | .. warning:: as of version 1.7.0, this option is deprecated because of its |
3330 | 367 | redundancy with ``openerp_scripts``. | 392 | redundancy with :ref:`openerp_scripts`. |
3331 | 368 | 393 | ||
3332 | 369 | OpenERP startup scripts are created in the `bin` directory. By default the name is: | 394 | OpenERP startup scripts are created in the `bin` directory. By default |
3333 | 370 | start_<part_name>, so you can have several startup scripts for each part if you | 395 | the name is ``start_<part_name>``, so you can have several startup |
3334 | 371 | configure several OpenERP servers or clients. You can pass additional typical | 396 | scripts for each part if you configure several OpenERP servers or clients. |
3335 | 397 | |||
3336 | 398 | You can pass additional typical | ||
3337 | 372 | arguments to the server via the startup script, such as -i or -u options. | 399 | arguments to the server via the startup script, such as -i or -u options. |
3338 | 373 | 400 | ||
3339 | 374 | You can choose another name for the script by using the *script_name* | 401 | You can choose another name for the script by using the *script_name* |
3340 | 375 | option :: | 402 | option :: |
3341 | 376 | 403 | ||
3452 | 377 | script_name = start_erp | 404 | script_name = start_erp |
3453 | 378 | 405 | ||
3454 | 379 | interpreter_name | 406 | |
3455 | 380 | ---------------- | 407 | .. _openerp_scripts: |
3456 | 381 | 408 | ||
3457 | 382 | The recipe will automatically create a python interpreter with a | 409 | openerp_scripts |
3458 | 383 | ``session`` object that can bootstrap OpenERP with a database right | 410 | --------------- |
3459 | 384 | away. You can use that for interactive sessions or to launch a script:: | 411 | This option lets you install console scripts provided by any of the loaded eggs, |
3460 | 385 | 412 | so that they can access to OpenERP internals and load databases. | |
3461 | 386 | $ bin/python_openerp | 413 | |
3462 | 387 | To start the OpenERP working session, just do: | 414 | .. note:: new in version 1.7.0 |
3463 | 388 | session.open() | 415 | |
3464 | 389 | or | 416 | Here we describe the format of the option only. |
3465 | 390 | session.open(db=DATABASE_NAME) | 417 | For explanation about what it means and how to use it, please refer to |
3466 | 391 | Then you can issue commands such as | 418 | :doc:`/scripts`. |
3467 | 392 | session.registry('res.users').browse(session.cr, 1, 1) | 419 | |
3468 | 393 | 420 | The option is multiline. Each line specifies exactly one | |
3469 | 394 | >>> | 421 | script, and must respect the following format: |
3470 | 395 | 422 | ||
3471 | 396 | The interpreter name is ``python_<part_name>`` by default; but it can | 423 | ``ENTRY_POINT_NAME[=WISHED_SCRIPT_NAME] [MODIFIER [MODIFIER […]]]`` |
3472 | 397 | be explicitely set like this:: | 424 | |
3473 | 398 | 425 | Each modifier takes the ``MODIFIER_NAME=MODIFIER_VALUE`` form. | |
3474 | 399 | interpreter_name = my_py | 426 | No whitespace is allowed in modifiers, entry point, nor produced script names. |
3475 | 400 | 427 | ||
3476 | 401 | If you want *not* to have the interpreter, juste do | 428 | Here's the list of currently available modifiers, with links inside :doc:`the |
3477 | 402 | 429 | dedicated chapter about OpenERP scripts </scripts>`). | |
3478 | 403 | interpreter_name = | 430 | |
3479 | 404 | 431 | :command-line-options: :ref:`command_line_options` | |
3480 | 405 | The bootstrapping facility may also be used within a script installed | 432 | :arguments: :ref:`arguments_session` |
3481 | 406 | by an egg; just insert this in your code to get the session object as | 433 | |
3482 | 407 | if you were in the interpreter:: | 434 | Full example:: |
3483 | 408 | 435 | ||
3484 | 409 | from anybox.recipe.openerp.startup import Session | 436 | openerp_scripts = my_script arguments=session |
3485 | 410 | session = Session() | 437 | my_other_script=actual-script-name arguments=3,session |
3486 | 411 | 438 | nosetests=nosetests command-line-options=-d | |
3487 | 412 | .. note:: this facility is new in version 1.6.0, and tested with | 439 | |
3488 | 413 | OpenERP 7 only for now. | 440 | |
3489 | 414 | 441 | .. _upgrade_script_name: | |
3490 | 415 | startup_delay | 442 | |
3491 | 416 | ------------- | 443 | upgrade_script_name |
3492 | 417 | 444 | ------------------- | |
3493 | 418 | Specifies a delay in seconds to wait before actually launching OpenERP. This | 445 | |
3494 | 419 | option was a preliminary hack to support both gunicorn instance and a legacy | 446 | This option lets you specify the wished name for the upgrade script. |
3495 | 420 | instance. The Gunicorn startup script (see below) itself is not affected by | 447 | The default value is ``upgrade_<part_name>``. |
3496 | 421 | this setting :: | 448 | |
3497 | 422 | 449 | .. note:: new in version 1.8.0. | |
3498 | 423 | startup_delay = 3 | 450 | |
3499 | 424 | 451 | We are actually not sure to keep that option, since it's | |
3500 | 425 | with_devtools | 452 | redundant with :ref:`openerp_scripts`. |
3501 | 426 | ------------- | 453 | |
3502 | 427 | Allows to load development and install useful devlopment and testing | 454 | |
3503 | 428 | tools, notably the following scripts: | 455 | .. _upgrade_script: |
3504 | 429 | 456 | ||
3505 | 430 | * ``test_openerp``: a uniform test launcher for all supported | 457 | upgrade_script |
3506 | 431 | versions. See test_script_name option below for details. | 458 | -------------- |
3507 | 432 | * ``openerp_command``: see openerp_command_name option below for | 459 | |
3508 | 433 | details. Not installed for OpenERP major versions less than or equal to 6.1. | 460 | .. note:: new in version 1.8.0 |
3509 | 434 | 461 | ||
3510 | 435 | This option is False by default, hence it's activated this way:: | 462 | This option lets you specify a source (``.py``) file and a callable |
3511 | 436 | 463 | defined in that file to perform database upgrades. The default value | |
3512 | 437 | with_devtools = true | 464 | is:: |
3513 | 438 | 465 | ||
3514 | 439 | It will also add some dependencies that are typical to development | 466 | upgrade_script = upgrade.py run |
3515 | 440 | setups (tests related packages etc.) and automatically load where | 467 | |
3516 | 441 | needed helpers, such as `anybox.testing.datetime | 468 | If the specified source file doest not exist, the recipe will |
3517 | 442 | <http://pypi.python.org/pypi/anybox.testing.datetime>`_ (allows to | 469 | initialize it with a simple and meaningful sample content, consistent |
3518 | 443 | cheat with system time). | 470 | with the default value above. |
3519 | 444 | 471 | ||
3520 | 445 | test_script_name | 472 | If you want *not* to have an upgrade script, just override this option |
3521 | 446 | ---------------- | 473 | with a blank value:: |
3522 | 447 | .. warning:: as of version 1.7.0, this option is deprecated because of its | 474 | |
3523 | 448 | redundancy with ``openerp_scripts``. | 475 | upgrade_script = |
3524 | 449 | 476 | ||
3525 | 450 | If the ``with_devtools`` is set to True, the recipe will create a | 477 | See the full :ref:`upgrade_scripts` documentation to learn more |
3526 | 451 | test script, which is named by default ``test_<part_name>``. You may | 478 | about upgrade scripts. |
3527 | 452 | override the name in the configuration as in the following example:: | 479 | |
3528 | 453 | 480 | .. note:: new in version 1.8.0 | |
3529 | 454 | test_script_name = test_erp | 481 | |
3530 | 455 | 482 | ||
3531 | 456 | The test script takes the same arguments as the regular startup | 483 | .. _gunicorn: |
3422 | 457 | script:: | ||
3423 | 458 | |||
3424 | 459 | bin/test_openerp --help | ||
3425 | 460 | bin/test_openerp -d test_db -i purchase,sale | ||
3426 | 461 | |||
3427 | 462 | At the time of this writing, all this script does compared to the | ||
3428 | 463 | regular startup script is to bring uniformity across OpenERP versions | ||
3429 | 464 | by tweaking options internally. | ||
3430 | 465 | |||
3431 | 466 | base_url | ||
3432 | 467 | -------- | ||
3433 | 468 | |||
3434 | 469 | URL from which to download official and nightly versions | ||
3435 | 470 | (assuming the archive filenames are constistent with those in | ||
3436 | 471 | OpenERP download server). This is a basic mirroring capability:: | ||
3437 | 472 | |||
3438 | 473 | base_url = http://download.example.com/openerp/ | ||
3439 | 474 | |||
3440 | 475 | openerp-downloads-directory | ||
3441 | 476 | --------------------------- | ||
3442 | 477 | |||
3443 | 478 | Allows to share OpenERP downloads among several buildouts. You should put this | ||
3444 | 479 | option in your ``~/.buildout/default.cfg`` file. It specifies the destination | ||
3445 | 480 | download directory for OpenERP archives. The path may be absolute or relative | ||
3446 | 481 | to the buildout directory. | ||
3447 | 482 | |||
3448 | 483 | Example:: | ||
3449 | 484 | |||
3450 | 485 | [buildout] | ||
3451 | 486 | openerp-downloads-directory = /home/user/.buildout/openerp-downloads | ||
3532 | 487 | 484 | ||
3533 | 488 | gunicorn | 485 | gunicorn |
3534 | 489 | -------- | 486 | -------- |
3535 | 490 | 487 | ||
3537 | 491 | Gunicorn integration is only supported on OpenERP >= 6.1. | 488 | Gunicorn integration is only supported on OpenERP ≥ 6.1. |
3538 | 492 | Any value of this option makes the recipe generate a script to start | 489 | Any value of this option makes the recipe generate a script to start |
3539 | 493 | OpenERP with Gunicorn and (*new in version 1.1*) a dedicated script to | 490 | OpenERP with Gunicorn and (*new in version 1.1*) a dedicated script to |
3540 | 494 | handle cron jobs. | 491 | handle cron jobs. |
3541 | 495 | 492 | ||
3542 | 496 | For OpenERP 6.1, the only accepted values are ``direct`` and | 493 | For OpenERP 6.1, the only accepted values are ``direct`` and |
3544 | 497 | ``proxied``. Any value is suitable for OpenERP >= 7 | 494 | ``proxied``. Any value is suitable for OpenERP ≥ 7 |
3545 | 498 | 495 | ||
3546 | 499 | Proxied mode | 496 | Proxied mode |
3547 | 500 | ```````````` | 497 | ```````````` |
3548 | @@ -503,7 +500,7 @@ | |||
3549 | 503 | 500 | ||
3550 | 504 | gunicorn = proxied | 501 | gunicorn = proxied |
3551 | 505 | 502 | ||
3553 | 506 | This behaviour has been kept for OpenERP >= 7 to keep | 503 | This behaviour has been kept for OpenERP ≥ 7 to keep |
3554 | 507 | backwards compatibility, but the option is now superseded by the | 504 | backwards compatibility, but the option is now superseded by the |
3555 | 508 | general ``proxy_mode`` option of the server. In the buildout context, | 505 | general ``proxy_mode`` option of the server. In the buildout context, |
3556 | 509 | that'd be:: | 506 | that'd be:: |
3557 | @@ -552,25 +549,24 @@ | |||
3558 | 552 | allows for graceful restarts (use this for minor changes only). | 549 | allows for graceful restarts (use this for minor changes only). |
3559 | 553 | 550 | ||
3560 | 554 | 551 | ||
3561 | 552 | .. _openerp_command_name: | ||
3562 | 553 | |||
3563 | 555 | openerp_command_name | 554 | openerp_command_name |
3564 | 556 | -------------------- | 555 | -------------------- |
3567 | 557 | .. warning:: as of version 1.7.0, this option is deprecated, check | 556 | .. warning:: as of version 1.7.0, this option is deprecated because of |
3568 | 558 | ``openerp_scripts`` for more details. | 557 | its redundancy with :ref:`openerp_scripts`. |
3569 | 559 | 558 | ||
3570 | 560 | OpenERP Command Line Tools (openerp-command for short) is an | 559 | OpenERP Command Line Tools (openerp-command for short) is an |
3571 | 561 | alternative set of command-line tools that may someday subsede the | 560 | alternative set of command-line tools that may someday subsede the |
3572 | 562 | current monolithic startup script. Currently experimental, but | 561 | current monolithic startup script. Currently experimental, but |
3573 | 563 | already very useful in development mode. | 562 | already very useful in development mode. |
3574 | 564 | 563 | ||
3576 | 565 | It is currently enabled if the ``with_devtools`` option is on. | 564 | It is currently enabled if the :ref:`with_devtools` option is on. |
3577 | 566 | 565 | ||
3578 | 567 | This works by requiring the ``openerp-command`` python | 566 | This works by requiring the ``openerp-command`` python |
3585 | 568 | distribution, which is not on PyPI as of this writting. You may want | 567 | distribution, which is not on PyPI as of this writting, but comes |
3586 | 569 | to use the ``vcsdevelop`` extension to get it from Launchpad:: | 568 | bundled with the current OpenERP trunk (believed to be the future |
3587 | 570 | 569 | OpenERP 8). | |
3582 | 571 | [buildout] | ||
3583 | 572 | extensions = gp.vcsdevelop | ||
3584 | 573 | vcs-extend-develop = bzr+http://bazaar.launchpad.net/openerp/openerp-command#egg=openerp-command | ||
3588 | 574 | 570 | ||
3589 | 575 | As for other scripts, you can control its name of the produced script, e.g:: | 571 | As for other scripts, you can control its name of the produced script, e.g:: |
3590 | 576 | 572 | ||
3591 | @@ -580,11 +576,226 @@ | |||
3592 | 580 | ``oe`` is the classical name for this script outside of the realm of | 576 | ``oe`` is the classical name for this script outside of the realm of |
3593 | 581 | this buildout recipe. | 577 | this buildout recipe. |
3594 | 582 | 578 | ||
3595 | 579 | .. note:: ``openerp-command`` has first been introduced as a separate | ||
3596 | 580 | project while OpenERP 7.0 was in development stage. People | ||
3597 | 581 | wanting to use it with OpenERP 7.0 can still grab it from | ||
3598 | 582 | Launchpad with the ``gp.vcsdevelop`` extension:: | ||
3599 | 583 | |||
3600 | 584 | [buildout] | ||
3601 | 585 | extensions = gp.vcsdevelop | ||
3602 | 586 | vcs-extend-develop = bzr+http://bazaar.launchpad.net/openerp/openerp-command@419#egg=openerp-command | ||
3603 | 587 | |||
3604 | 588 | The latest Launchpad revision is actually the final removal, | ||
3605 | 589 | done at the time where it's been included in | ||
3606 | 590 | ``lp:openobject-server``. | ||
3607 | 591 | |||
3608 | 592 | |||
3609 | 583 | .. warning:: | 593 | .. warning:: |
3610 | 584 | 594 | ||
3614 | 585 | Do not use to launch production servers, especially in an automatic | 595 | On OpenERP 7, do not use to launch production servers, especially in |
3615 | 586 | way, openerp-command is really unstable and that may damage your | 596 | an automatic way, ``openerp-command`` is really unstable and that |
3616 | 587 | installation. | 597 | may damage your installation. |
3617 | 598 | |||
3618 | 599 | |||
3619 | 600 | |||
3620 | 601 | scripts | ||
3621 | 602 | ------- | ||
3622 | 603 | .. note:: This option is useful for general purpose scripts | ||
3623 | 604 | only. For scripts related to OpenERP, see | ||
3624 | 605 | :doc:`/scripts`, and the :ref:`openerp_scripts` option. | ||
3625 | 606 | |||
3626 | 607 | This option controls the generation of console scripts declared by the | ||
3627 | 608 | various involved Python distributions (either directly required with | ||
3628 | 609 | the :ref:`eggs` option, or by dependency). | ||
3629 | 610 | |||
3630 | 611 | By default, no such script is generated, but you may specify some | ||
3631 | 612 | according to your needs, with the same semantics as in ``zc.recipe.egg``. | ||
3632 | 613 | |||
3633 | 614 | scripts = change_tz | ||
3634 | 615 | |||
3635 | 616 | In the current state, beware to *not* require the same script in different | ||
3636 | 617 | parts or rename them. See | ||
3637 | 618 | https://bugs.launchpad.net/anybox.recipe.openerp/+bug/1020967 for | ||
3638 | 619 | details. | ||
3639 | 620 | |||
3640 | 621 | |||
3641 | 622 | .. _startup_delay: | ||
3642 | 623 | |||
3643 | 624 | startup_delay | ||
3644 | 625 | ------------- | ||
3645 | 626 | |||
3646 | 627 | Specifies a delay in seconds to wait before actually launching OpenERP. This | ||
3647 | 628 | option was a preliminary hack to support both gunicorn instance and a legacy | ||
3648 | 629 | instance. The Gunicorn startup script (see below) itself is not affected by | ||
3649 | 630 | this setting :: | ||
3650 | 631 | |||
3651 | 632 | startup_delay = 3 | ||
3652 | 633 | |||
3653 | 634 | Options for development, QA and introspection | ||
3654 | 635 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
3655 | 636 | |||
3656 | 637 | .. _with_devtools: | ||
3657 | 638 | |||
3658 | 639 | with_devtools | ||
3659 | 640 | ------------- | ||
3660 | 641 | Allows to load development and install useful devlopment and testing | ||
3661 | 642 | tools, notably the following scripts: | ||
3662 | 643 | |||
3663 | 644 | * ``test_openerp``: a uniform test launcher for all supported | ||
3664 | 645 | versions. See test_script_name option below for details. | ||
3665 | 646 | * ``openerp_command``: see openerp_command_name option below for | ||
3666 | 647 | details. Not installed for OpenERP major versions less than or equal to 6.1. | ||
3667 | 648 | |||
3668 | 649 | This option is False by default, hence it's activated this way:: | ||
3669 | 650 | |||
3670 | 651 | with_devtools = true | ||
3671 | 652 | |||
3672 | 653 | It will also add some dependencies that are typical to development | ||
3673 | 654 | setups (tests related packages etc.) and automatically load where | ||
3674 | 655 | needed helpers, such as `anybox.testing.datetime | ||
3675 | 656 | <http://pypi.python.org/pypi/anybox.testing.datetime>`_ (allows to | ||
3676 | 657 | cheat with system time). | ||
3677 | 658 | |||
3678 | 659 | |||
3679 | 660 | .. _test_script_name: | ||
3680 | 661 | |||
3681 | 662 | test_script_name | ||
3682 | 663 | ---------------- | ||
3683 | 664 | .. warning:: as of version 1.7.0, this option is deprecated because of its | ||
3684 | 665 | redundancy with :ref:`openerp_scripts`. | ||
3685 | 666 | |||
3686 | 667 | If the ``with_devtools`` is set to True, the recipe will create a | ||
3687 | 668 | test script, which is named by default ``test_<part_name>``. You may | ||
3688 | 669 | override the name in the configuration as in the following example:: | ||
3689 | 670 | |||
3690 | 671 | test_script_name = test_erp | ||
3691 | 672 | |||
3692 | 673 | The test script takes the same arguments as the regular startup | ||
3693 | 674 | script:: | ||
3694 | 675 | |||
3695 | 676 | bin/test_openerp --help | ||
3696 | 677 | bin/test_openerp -d test_db -i purchase,sale | ||
3697 | 678 | |||
3698 | 679 | At the time of this writing, all this script does compared to the | ||
3699 | 680 | regular startup script is to bring uniformity across OpenERP versions | ||
3700 | 681 | by tweaking options internally. | ||
3701 | 682 | |||
3702 | 683 | *As of version 1.8.2*, the ``--install-all`` additional option will be | ||
3703 | 684 | expanded on-the-fly as ``-i`` on all available modules (don't confuse | ||
3704 | 685 | with ``-i all``: the latter is equivalent to ``-i base``). | ||
3705 | 686 | |||
3706 | 687 | |||
3707 | 688 | .. _interpreter_name: | ||
3708 | 689 | |||
3709 | 690 | interpreter_name | ||
3710 | 691 | ---------------- | ||
3711 | 692 | |||
3712 | 693 | The recipe will automatically create a python interpreter with a | ||
3713 | 694 | ``session`` object that can bootstrap OpenERP with a database right | ||
3714 | 695 | away. You can use that for interactive sessions or to launch a script:: | ||
3715 | 696 | |||
3716 | 697 | $ bin/python_openerp | ||
3717 | 698 | To start the OpenERP working session, just do: | ||
3718 | 699 | session.open() | ||
3719 | 700 | or | ||
3720 | 701 | session.open(db=DATABASE_NAME) | ||
3721 | 702 | Then you can issue commands such as | ||
3722 | 703 | session.registry('res.users').browse(session.cr, 1, 1) | ||
3723 | 704 | |||
3724 | 705 | >>> | ||
3725 | 706 | |||
3726 | 707 | The interpreter name is ``python_<part_name>`` by default; but it can | ||
3727 | 708 | be explicitely set like this:: | ||
3728 | 709 | |||
3729 | 710 | interpreter_name = my_py | ||
3730 | 711 | |||
3731 | 712 | If you want *not* to have the interpreter, juste do | ||
3732 | 713 | |||
3733 | 714 | interpreter_name = | ||
3734 | 715 | |||
3735 | 716 | If you want to wrap a python script with such session objects, read | ||
3736 | 717 | :doc:`/scripts` and especially :ref:`arguments_session`. | ||
3737 | 718 | See also :ref:`openerp_scripts`. | ||
3738 | 719 | |||
3739 | 720 | .. note:: this facility is new in version 1.6.0, and tested with | ||
3740 | 721 | OpenERP ≥ 6.1 only for now. | ||
3741 | 722 | |||
3742 | 723 | |||
3743 | 724 | interpreter | ||
3744 | 725 | ----------- | ||
3745 | 726 | With the ``gtkclient`` and ``webclient`` recipes, | ||
3746 | 727 | this behauves like the `interpreter` option of `zc.recipe.egg`: it | ||
3747 | 728 | gives you a Python interpreter in the ``bin`` subdirectory of the buildout:: | ||
3748 | 729 | |||
3749 | 730 | interpreter = erp_python | ||
3750 | 731 | |||
3751 | 732 | With the ``server`` recipe, the ``interpreter`` option will be ignored, | ||
3752 | 733 | because this recipe always creates an interpreter with preloaded objects to | ||
3753 | 734 | bootstrap openerp, and these depend on the configuration. | ||
3754 | 735 | Check :ref:`interpreter_name` for more details. | ||
3755 | 736 | |||
3756 | 737 | |||
3757 | 738 | |||
3758 | 739 | |||
3759 | 740 | Options for download and caching strategies | ||
3760 | 741 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
3761 | 742 | |||
3762 | 743 | Let us start by listing a few global buildout options (to be put in | ||
3763 | 744 | the ``[buildout]`` section), whose scope is much larger than the | ||
3764 | 745 | OpenERP recipe. | ||
3765 | 746 | |||
3766 | 747 | :eggs-directory: control where eggs are stored after download and/or | ||
3767 | 748 | build and reciprocally acts as a cache. | ||
3768 | 749 | :index: specifies where to get informations about distributions not found in | ||
3769 | 750 | ``eggs-directory``. | ||
3770 | 751 | :find-links: direct URLs to look for distributions | ||
3771 | 752 | :allow-hosts: white list of URL patterns allowed for distributions | ||
3772 | 753 | download. Great to exclude the numerous useless sites | ||
3773 | 754 | that setuptools may want to crawl and which tend to | ||
3774 | 755 | break each time a new version gets referenced on PyPI. | ||
3775 | 756 | |||
3776 | 757 | The OpenERP recipes define a few more. | ||
3777 | 758 | |||
3778 | 759 | |||
3779 | 760 | .. _base_url: | ||
3780 | 761 | |||
3781 | 762 | base_url | ||
3782 | 763 | -------- | ||
3783 | 764 | This option is local to the *part*. | ||
3784 | 765 | |||
3785 | 766 | URL from which to download official and nightly versions | ||
3786 | 767 | (assuming the archive filenames are constistent with those in | ||
3787 | 768 | OpenERP download server). This is a basic mirroring capability:: | ||
3788 | 769 | |||
3789 | 770 | base_url = http://download.example.com/openerp/ | ||
3790 | 771 | |||
3791 | 772 | |||
3792 | 773 | .. _openerp-downloads-directory: | ||
3793 | 774 | |||
3794 | 775 | openerp-downloads-directory | ||
3795 | 776 | --------------------------- | ||
3796 | 777 | This is an option for the ``[buildout]`` section | ||
3797 | 778 | |||
3798 | 779 | Allows to share OpenERP downloads among several buildouts. You should put this | ||
3799 | 780 | option in your ``~/.buildout/default.cfg`` file. It specifies the destination | ||
3800 | 781 | download directory for OpenERP archives. The path may be absolute or relative | ||
3801 | 782 | to the buildout directory. | ||
3802 | 783 | |||
3803 | 784 | Example:: | ||
3804 | 785 | |||
3805 | 786 | [buildout] | ||
3806 | 787 | openerp-downloads-directory = /home/user/.buildout/openerp-downloads | ||
3807 | 788 | |||
3808 | 789 | |||
3809 | 790 | |||
3810 | 791 | Options for release and packaging | ||
3811 | 792 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
3812 | 793 | |||
3813 | 794 | .. note:: release and packaging should be provided by dedicated | ||
3814 | 795 | executables, not by options. These options should disappear | ||
3815 | 796 | at some point between 1.8 and 1.9 versions. | ||
3816 | 797 | |||
3817 | 798 | .. _freeze-to: | ||
3818 | 588 | 799 | ||
3819 | 589 | freeze-to | 800 | freeze-to |
3820 | 590 | --------- | 801 | --------- |
3821 | @@ -613,7 +824,7 @@ | |||
3822 | 613 | bin/buildout -o openerp-server-1:freeze-to=frozen.cfg | 824 | bin/buildout -o openerp-server-1:freeze-to=frozen.cfg |
3823 | 614 | 825 | ||
3824 | 615 | This produces a buildout configuration file named ``frozen.cfg``, | 826 | This produces a buildout configuration file named ``frozen.cfg``, |
3826 | 616 | with notably an ``openerp-server-1`` part having a ``revisions`` option that | 827 | with notably an ``openerp-server-1`` part having a :ref:`revisions` option that |
3827 | 617 | freezes everything. | 828 | freezes everything. |
3828 | 618 | 829 | ||
3829 | 619 | For configurations with several openerp related parts, you can freeze | 830 | For configurations with several openerp related parts, you can freeze |
3830 | @@ -641,22 +852,25 @@ | |||
3831 | 641 | .. warning:: currently ``freeze-to`` cannot fix eggs versions related | 852 | .. warning:: currently ``freeze-to`` cannot fix eggs versions related |
3832 | 642 | to non-openerp parts. | 853 | to non-openerp parts. |
3833 | 643 | 854 | ||
3834 | 855 | .. _freeze-allow-picked-versions: | ||
3835 | 856 | |||
3836 | 644 | freeze-allow-picked-versions | 857 | freeze-allow-picked-versions |
3837 | 645 | ---------------------------- | 858 | ---------------------------- |
3838 | 646 | 859 | ||
3840 | 647 | This option is to be used in conjunction with ``freeze-to``. If set to | 860 | This option is to be used in conjunction with :ref:`freeze-to`. If set to |
3841 | 648 | ``False``, it will add ``allow-picked-versions = false`` | 861 | ``False``, it will add ``allow-picked-versions = false`` |
3842 | 649 | for ``zc.buildout`` versions that support this flag. | 862 | for ``zc.buildout`` versions that support this flag. |
3843 | 650 | 863 | ||
3844 | 651 | .. warning:: in the current state of things, this can cause problems | 864 | .. warning:: in the current state of things, this can cause problems |
3847 | 652 | if you have non-openerp parts (see warning in ``freeze-to`` | 865 | if you have non-openerp parts (see the various warnings |
3848 | 653 | documentation). | 866 | in :ref:`freeze-to`) |
3849 | 654 | 867 | ||
3850 | 868 | .. _extract-downloads-to: | ||
3851 | 655 | 869 | ||
3852 | 656 | extract-downloads-to | 870 | extract-downloads-to |
3853 | 657 | -------------------- | 871 | -------------------- |
3854 | 658 | 872 | ||
3856 | 659 | Following the same kind of logic as ``freeze-to``, this option allows | 873 | Following the same kind of logic as :ref:`freeze-to`, this option allows |
3857 | 660 | to turn a buildout that aggregates from various remote sources | 874 | to turn a buildout that aggregates from various remote sources |
3858 | 661 | (tarball downloads, VCSes) into a self-contained buildout archive | 875 | (tarball downloads, VCSes) into a self-contained buildout archive |
3859 | 662 | directory that can be packed for easy distribution. | 876 | directory that can be packed for easy distribution. |
3860 | @@ -685,8 +899,8 @@ | |||
3861 | 685 | or further extended for system-dependent options such as port, db | 899 | or further extended for system-dependent options such as port, db |
3862 | 686 | connection, etc. | 900 | connection, etc. |
3863 | 687 | 901 | ||
3866 | 688 | The ``extract-downloads-to`` options can be used for several parts | 902 | The ``extract-downloads-to`` option can be used for several parts |
3867 | 689 | with the same target directory (same as ``freeze-to``). | 903 | with the same target directory (same as :ref:`freeze-to`). |
3868 | 690 | 904 | ||
3869 | 691 | Furthermore, a default ``freeze-to`` is issued, producing a buildout | 905 | Furthermore, a default ``freeze-to`` is issued, producing a buildout |
3870 | 692 | configuration called ``extracted_from.cfg`` in the target directory, | 906 | configuration called ``extracted_from.cfg`` in the target directory, |
3871 | @@ -698,317 +912,3 @@ | |||
3872 | 698 | same rules with respect to uncommitted changes. | 912 | same rules with respect to uncommitted changes. |
3873 | 699 | 913 | ||
3874 | 700 | Python distributions managed with ``gp.vcsdevelop`` are taken into account. | 914 | Python distributions managed with ``gp.vcsdevelop`` are taken into account. |
3875 | 701 | |||
3876 | 702 | |||
3877 | 703 | OpenERP options | ||
3878 | 704 | --------------- | ||
3879 | 705 | |||
3880 | 706 | You can define OpenERP options directly from the buildout file (usually | ||
3881 | 707 | ``buildout.cfg``) in the recipe section. | ||
3882 | 708 | The OpenERP configuration files are generated by OpenERP itself in the directory | ||
3883 | 709 | specified by ``etc-directory`` which defaults to the `etc` directory under your | ||
3884 | 710 | buildout directory. | ||
3885 | 711 | The settings of the OpenERP configuration files can be controlled using a | ||
3886 | 712 | dotted notation prefixed by the name of the corresponding section of the | ||
3887 | 713 | OpenERP config file. The specified options will just overwrite the existing | ||
3888 | 714 | options in the corresponding config files. You don't have to replicate all the | ||
3889 | 715 | options in your section of the buildout file. If a setting or a section does | ||
3890 | 716 | not natively exist in the openerp config file, it can be created from there for | ||
3891 | 717 | your application. | ||
3892 | 718 | |||
3893 | 719 | For example you can specify the xmlrpc port for the server or | ||
3894 | 720 | even an additional option that does not exist in the default config file:: | ||
3895 | 721 | |||
3896 | 722 | options.xmlrpc_port = 8069 | ||
3897 | 723 | options.additional_option = "foobar" | ||
3898 | 724 | |||
3899 | 725 | It will end-up in the server config as:: | ||
3900 | 726 | |||
3901 | 727 | [options] | ||
3902 | 728 | xmlrpc_port = 8069 | ||
3903 | 729 | additional_option = "foobar" | ||
3904 | 730 | |||
3905 | 731 | For the web client you can specify the company url with:: | ||
3906 | 732 | |||
3907 | 733 | global.server.socket_port = 8080 | ||
3908 | 734 | openerp-web.company.url = 'http://anybox.fr' | ||
3909 | 735 | |||
3910 | 736 | It will modify the corresponding web client config:: | ||
3911 | 737 | |||
3912 | 738 | [global] | ||
3913 | 739 | server.socket_port = 8080 | ||
3914 | 740 | |||
3915 | 741 | [openerp-web] | ||
3916 | 742 | company.url = 'http://anybox.fr' | ||
3917 | 743 | |||
3918 | 744 | |||
3919 | 745 | .. note:: Note that for security reason, the superadmin password is not set by | ||
3920 | 746 | default. If you want to create a database you should temporary set it manually | ||
3921 | 747 | in the etc/openerp.conf file | ||
3922 | 748 | |||
3923 | 749 | |||
3924 | 750 | |||
3925 | 751 | .. _howto: | ||
3926 | 752 | |||
3927 | 753 | How to create and bootstrap a buildout | ||
3928 | 754 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
3929 | 755 | |||
3930 | 756 | To create a buildout and run the build, you just need **1 file** and **2 commands**: | ||
3931 | 757 | |||
3932 | 758 | - Create a single ``buildout.cfg`` file. | ||
3933 | 759 | - Be sure you installed all your build dependencies | ||
3934 | 760 | - Bootstrap the buildout with: ``python bootstrap.py`` | ||
3935 | 761 | - Run the build with: ``bin/buildout`` | ||
3936 | 762 | |||
3937 | 763 | The same with more details below : | ||
3938 | 764 | |||
3939 | 765 | Creating the buildout | ||
3940 | 766 | --------------------- | ||
3941 | 767 | |||
3942 | 768 | Create a ``buildout.cfg`` file in an empty directory, containing the | ||
3943 | 769 | configuration of the `example 6.1`_ section. | ||
3944 | 770 | |||
3945 | 771 | .. _dependencies: | ||
3946 | 772 | |||
3947 | 773 | Installing build dependencies | ||
3948 | 774 | ----------------------------- | ||
3949 | 775 | |||
3950 | 776 | You basically need typical development tools needed to build all the Python | ||
3951 | 777 | dependency eggs of OpenERP. You can do this by yourself with your system or | ||
3952 | 778 | Linux distribution. | ||
3953 | 779 | |||
3954 | 780 | Or if you're using a Debian system, we provide a single dependency package you | ||
3955 | 781 | can use to install all dependencies in one shot: | ||
3956 | 782 | |||
3957 | 783 | Add the following line in your ``/etc/apt/sources.list``:: | ||
3958 | 784 | |||
3959 | 785 | deb http://apt.anybox.fr/openerp common main | ||
3960 | 786 | |||
3961 | 787 | Install the dependency package:: | ||
3962 | 788 | |||
3963 | 789 | $ sudo aptitude update | ||
3964 | 790 | $ sudo aptitude install openerp-server-system-build-deps | ||
3965 | 791 | |||
3966 | 792 | You can uninstall this package with `aptitude` after the build to | ||
3967 | 793 | automatically remove all un-needed dependencies, but you need to | ||
3968 | 794 | install *run dependencies* before that :: | ||
3969 | 795 | |||
3970 | 796 | $ sudo aptitude install openerp-server-system-run-deps | ||
3971 | 797 | $ sudo aptitude remove openerp-server-system-build-deps | ||
3972 | 798 | |||
3973 | 799 | Please note that these package will have your system install the | ||
3974 | 800 | *client* part of PostgreSQL software only. If you want a | ||
3975 | 801 | PostgreSQL server on the same host, that's not in the recipe scope, | ||
3976 | 802 | just install it as well. | ||
3977 | 803 | |||
3978 | 804 | Bootstrapping the buildout | ||
3979 | 805 | -------------------------- | ||
3980 | 806 | |||
3981 | 807 | Bootstrapping the buildout consists in creating the basic structure of the buildout, and installing buildout itself in the directory. | ||
3982 | 808 | |||
3983 | 809 | The easiest and recommended way to bootstrap is to use a ``bootstrap.py`` script:: | ||
3984 | 810 | |||
3985 | 811 | $ wget https://raw.github.com/buildout/buildout/master/bootstrap/bootstrap.py | ||
3986 | 812 | $ python bootstrap.py | ||
3987 | 813 | |||
3988 | 814 | As an alternative and more complicated solution, you may also bootstrap by | ||
3989 | 815 | creating a virtualenv, installing zc.buildout, then run the bootstrap:: | ||
3990 | 816 | |||
3991 | 817 | $ virtualenv sandbox | ||
3992 | 818 | $ sandbox/bin/pip install zc.buildout | ||
3993 | 819 | $ sandbox/bin/buildout bootstrap | ||
3994 | 820 | |||
3995 | 821 | Running the build | ||
3996 | 822 | ----------------- | ||
3997 | 823 | |||
3998 | 824 | Just run :: | ||
3999 | 825 | |||
4000 | 826 | $ bin/buildout | ||
4001 | 827 | |||
4002 | 828 | Starting OpenERP | ||
4003 | 829 | ---------------- | ||
4004 | 830 | |||
4005 | 831 | Just run :: | ||
4006 | 832 | |||
4007 | 833 | $ bin/start_openerp | ||
4008 | 834 | |||
4009 | 835 | |||
4010 | 836 | .. _example 6.1: | ||
4011 | 837 | |||
4012 | 838 | Example OpenERP 6.1 buildout | ||
4013 | 839 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
4014 | 840 | |||
4015 | 841 | Here is a very simple example for a latest OpenERP 6.1 nightly and a | ||
4016 | 842 | custom addon hosted on Bitbucket: | ||
4017 | 843 | |||
4018 | 844 | :: | ||
4019 | 845 | |||
4020 | 846 | [buildout] | ||
4021 | 847 | parts = openerp | ||
4022 | 848 | versions = versions | ||
4023 | 849 | find-links = http://download.gna.org/pychart/ | ||
4024 | 850 | |||
4025 | 851 | [openerp] | ||
4026 | 852 | recipe = anybox.recipe.openerp:server | ||
4027 | 853 | # replace '6.1' with 'trunk' to get a 7.0 current nightly: | ||
4028 | 854 | version = nightly 6.1 latest | ||
4029 | 855 | addons = hg https://bitbucket.org/anybox/anytracker addons-at default | ||
4030 | 856 | |||
4031 | 857 | [versions] | ||
4032 | 858 | MarkupSafe = 0.15 | ||
4033 | 859 | Pillow = 1.7.7 | ||
4034 | 860 | PyXML = 0.8.4 | ||
4035 | 861 | babel = 0.9.6 | ||
4036 | 862 | feedparser = 5.1.1 | ||
4037 | 863 | gdata = 2.0.16 | ||
4038 | 864 | lxml = 2.3.3 | ||
4039 | 865 | mako = 0.6.2 | ||
4040 | 866 | psycopg2 = 2.4.4 | ||
4041 | 867 | pychart = 1.39 | ||
4042 | 868 | pydot = 1.0.28 | ||
4043 | 869 | pyparsing = 1.5.6 | ||
4044 | 870 | python-dateutil = 1.5 | ||
4045 | 871 | python-ldap = 2.4.9 | ||
4046 | 872 | python-openid = 2.2.5 | ||
4047 | 873 | pytz = 2012b | ||
4048 | 874 | pywebdav = 0.9.4.1 | ||
4049 | 875 | pyyaml = 3.10 | ||
4050 | 876 | reportlab = 2.5 | ||
4051 | 877 | simplejson = 2.4.0 | ||
4052 | 878 | vatnumber = 1.0 | ||
4053 | 879 | vobject = 0.8.1c | ||
4054 | 880 | werkzeug = 0.8.3 | ||
4055 | 881 | xlwt = 0.7.3 | ||
4056 | 882 | zc.buildout = 1.5.2 | ||
4057 | 883 | zc.recipe.egg = 1.3.2 | ||
4058 | 884 | zsi = 2.0-rc3 | ||
4059 | 885 | |||
4060 | 886 | |||
4061 | 887 | .. note:: with OpenERP 6.1 the web client is natively included in the server as a | ||
4062 | 888 | simple module. In that case you don't need to write a separate part for the web | ||
4063 | 889 | client, unless that's what you really want to do. | ||
4064 | 890 | |||
4065 | 891 | |||
4066 | 892 | Example OpenERP 6.0 buildout | ||
4067 | 893 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
4068 | 894 | |||
4069 | 895 | Here is a sample buildout with version specification, 2 OpenERP servers (with | ||
4070 | 896 | one using the latest 6.0 branch on the launchpad) using only NETRPC and | ||
4071 | 897 | listening on 2 different ports, and 2 web clients:: | ||
4072 | 898 | |||
4073 | 899 | [buildout] | ||
4074 | 900 | parts = openerp1 web1 openerp2 web2 | ||
4075 | 901 | #allow-picked-versions = false | ||
4076 | 902 | versions = versions | ||
4077 | 903 | find-links = http://download.gna.org/pychart/ | ||
4078 | 904 | |||
4079 | 905 | [openerp1] | ||
4080 | 906 | recipe = anybox.recipe.openerp:server | ||
4081 | 907 | version = 6.0.3 | ||
4082 | 908 | options.xmlrpc = False | ||
4083 | 909 | options.xmlrpcs = False | ||
4084 | 910 | |||
4085 | 911 | [web1] | ||
4086 | 912 | recipe = anybox.recipe.openerp:webclient | ||
4087 | 913 | version = 6.0.3 | ||
4088 | 914 | |||
4089 | 915 | [openerp2] | ||
4090 | 916 | recipe = anybox.recipe.openerp:server | ||
4091 | 917 | version = bzr lp:openobject-server/6.0 openobject-server-6.x last:1 | ||
4092 | 918 | |||
4093 | 919 | options.xmlrpc = False | ||
4094 | 920 | options.xmlrpcs = False | ||
4095 | 921 | options.netrpc_port = 8170 | ||
4096 | 922 | |||
4097 | 923 | [web2] | ||
4098 | 924 | recipe = anybox.recipe.openerp:webclient | ||
4099 | 925 | version = 6.0.3 | ||
4100 | 926 | global.openerp.server.port = '8170' | ||
4101 | 927 | global.server.socket_port = 8180 | ||
4102 | 928 | |||
4103 | 929 | [versions] | ||
4104 | 930 | MarkupSafe = 0.15 | ||
4105 | 931 | Pillow = 1.7.7 | ||
4106 | 932 | anybox.recipe.openerp = 0.9 | ||
4107 | 933 | caldav = 0.1.10 | ||
4108 | 934 | collective.recipe.cmd = 0.5 | ||
4109 | 935 | coverage = 3.5 | ||
4110 | 936 | distribute = 0.6.25 | ||
4111 | 937 | feedparser = 5.0.1 | ||
4112 | 938 | lxml = 2.1.5 | ||
4113 | 939 | mako = 0.4.2 | ||
4114 | 940 | nose = 1.1.2 | ||
4115 | 941 | psycopg2 = 2.4.2 | ||
4116 | 942 | pychart = 1.39 | ||
4117 | 943 | pydot = 1.0.25 | ||
4118 | 944 | pyparsing = 1.5.6 | ||
4119 | 945 | python-dateutil = 1.5 | ||
4120 | 946 | pytz = 2012b | ||
4121 | 947 | pywebdav = 0.9.4.1 | ||
4122 | 948 | pyyaml = 3.10 | ||
4123 | 949 | reportlab = 2.5 | ||
4124 | 950 | vobject = 0.8.1c | ||
4125 | 951 | z3c.recipe.scripts = 1.0.1 | ||
4126 | 952 | zc.buildout = 1.5.2 | ||
4127 | 953 | zc.recipe.egg = 1.3.2 | ||
4128 | 954 | Babel = 0.9.6 | ||
4129 | 955 | FormEncode = 1.2.4 | ||
4130 | 956 | simplejson = 2.1.6 | ||
4131 | 957 | |||
4132 | 958 | |||
4133 | 959 | Other sample buildouts | ||
4134 | 960 | ~~~~~~~~~~~~~~~~~~~~~~ | ||
4135 | 961 | |||
4136 | 962 | Here are a few ready-to-use buildouts: | ||
4137 | 963 | |||
4138 | 964 | (Be sure to install system dependencies_ first) | ||
4139 | 965 | |||
4140 | 966 | OpenERP with the development branches of the Magento connector addons:: | ||
4141 | 967 | |||
4142 | 968 | $ hg clone https://bitbucket.org/anybox/openerp_connect_magento_buildout | ||
4143 | 969 | $ cd openerp_connect_magento_buildout | ||
4144 | 970 | $ python bootstrap.py | ||
4145 | 971 | $ bin/buildout | ||
4146 | 972 | $ bin/start_openerp | ||
4147 | 973 | |||
4148 | 974 | OpenERP with the development branches of the Prestashop connector addons:: | ||
4149 | 975 | |||
4150 | 976 | $ hg clone https://bitbucket.org/anybox/openerp_connect_prestashop_buildout | ||
4151 | 977 | $ cd openerp_connect_prestashop_buildout | ||
4152 | 978 | $ python bootstrap.py | ||
4153 | 979 | $ bin/buildout | ||
4154 | 980 | $ bin/start_openerp | ||
4155 | 981 | |||
4156 | 982 | Other examples are available in the ``buildbot`` subdirectory of the | ||
4157 | 983 | source distribution archive of this recipe (the ``tar.gz`` file that | ||
4158 | 984 | can be downloaded `from the PyPI | ||
4159 | 985 | <http://pypi.python.org/pypi/anybox.recipe.openerp>`_), and are | ||
4160 | 986 | continuously tested in the | ||
4161 | 987 | `anybox buildbot <http://buildbot.anybox.fr/>`_ which is powered by | ||
4162 | 988 | `anybox.buildbot.openerp <http://pypi.python.org/pypi/anybox.buildbot.openerp>`_. | ||
4163 | 989 | |||
4164 | 990 | |||
4165 | 991 | Contribute | ||
4166 | 992 | ~~~~~~~~~~ | ||
4167 | 993 | |||
4168 | 994 | Authors: | ||
4169 | 995 | |||
4170 | 996 | * Christophe Combelles | ||
4171 | 997 | * Georges Racinet | ||
4172 | 998 | |||
4173 | 999 | Contributors: | ||
4174 | 1000 | |||
4175 | 1001 | * Jean-Sébastien Suzanne | ||
4176 | 1002 | * Yannick Vaucher | ||
4177 | 1003 | * Jacques-Etienne Baudoux | ||
4178 | 1004 | * Laurent Mignon | ||
4179 | 1005 | * Leonardo Pistone | ||
4180 | 1006 | |||
4181 | 1007 | The primary branch is on the launchpad: | ||
4182 | 1008 | |||
4183 | 1009 | * Code repository and bug tracker: https://launchpad.net/anybox.recipe.openerp | ||
4184 | 1010 | * PyPI page: http://pypi.python.org/pypi/anybox.recipe.openerp | ||
4185 | 1011 | |||
4186 | 1012 | Please don't hesitate to give feedback and especially report bugs or | ||
4187 | 1013 | ask for new features through launchpad at this URL: https://bugs.launchpad.net/anybox.recipe.openerp/+bugs | ||
4188 | 1014 | |||
4189 | 1015 | 915 | ||
4190 | === added file 'doc/contributing.rst' | |||
4191 | --- doc/contributing.rst 1970-01-01 00:00:00 +0000 | |||
4192 | +++ doc/contributing.rst 2014-02-06 07:42:46 +0000 | |||
4193 | @@ -0,0 +1,187 @@ | |||
4194 | 1 | For contributors | ||
4195 | 2 | ================ | ||
4196 | 3 | |||
4197 | 4 | Source and tracking | ||
4198 | 5 | ~~~~~~~~~~~~~~~~~~~ | ||
4199 | 6 | The recipe is currently hosted as a launchpad project, under Bazaar | ||
4200 | 7 | version control: https://launchpad.net/anybox.recipe.openerp | ||
4201 | 8 | |||
4202 | 9 | We follow the standard launchpad workflow (bugs, merge requests…). | ||
4203 | 10 | Code contributors are systematically added to the list of | ||
4204 | 11 | contributors at the end of the README, unless they explicitely wish | ||
4205 | 12 | not to (what Launchpad does is obvisouly out of our scope). | ||
4206 | 13 | |||
4207 | 14 | There are currently no branch naming rules. | ||
4208 | 15 | |||
4209 | 16 | Members of the "Anybox" team have push privileges on the main branches. | ||
4210 | 17 | |||
4211 | 18 | Using a development version | ||
4212 | 19 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
4213 | 20 | |||
4214 | 21 | To use a local version of the recipe, you may use the ``develop`` | ||
4215 | 22 | general buildout option:: | ||
4216 | 23 | |||
4217 | 24 | [buildout] | ||
4218 | 25 | develop = /path/to/anybox.recipe.openerp | ||
4219 | 26 | |||
4220 | 27 | To track the latest version of a ``bzr`` branch of the recipe, we find | ||
4221 | 28 | the | ||
4222 | 29 | `gp.vcsdevelop <https://pypi.python.org/pypi/gp.vcsdevelop>`_ | ||
4223 | 30 | extension simple and useful. Here's an example (excerpt from | ||
4224 | 31 | ``buildot/recipe-trunk.cfg``):: | ||
4225 | 32 | |||
4226 | 33 | [buildout] | ||
4227 | 34 | extensions = gp.vcsdevelop | ||
4228 | 35 | vcs-extend-develop = bzr+http://bazaar.launchpad.net/~anybox/anybox.recipe.openerp/trunk#egg=anybox.recipe.openerp | ||
4229 | 36 | vcs-update = True | ||
4230 | 37 | |||
4231 | 38 | .. note:: | ||
4232 | 39 | Actually some parts of the recipe are aware of the possible use | ||
4233 | 40 | of ``gp.vcsdevelop`` for python dependencies, and special care of it is | ||
4234 | 41 | taken in the freeze and extract features. This is known to work even | ||
4235 | 42 | for ``zc.buildout`` itself. | ||
4236 | 43 | |||
4237 | 44 | Development setup | ||
4238 | 45 | ~~~~~~~~~~~~~~~~~ | ||
4239 | 46 | |||
4240 | 47 | We recommend "developping" the source code in a virtualenv, together | ||
4241 | 48 | with ``bzr``. For instance:: | ||
4242 | 49 | |||
4243 | 50 | virtualenv recipe-env | ||
4244 | 51 | recipe-env/bin/pip install bzr | ||
4245 | 52 | recipe-env/bin/bzr branch lp:anybox.recipe.openerp | ||
4246 | 53 | cd anybox.recipe.openerp | ||
4247 | 54 | python setup.py develop | ||
4248 | 55 | |||
4249 | 56 | Coding style | ||
4250 | 57 | ~~~~~~~~~~~~ | ||
4251 | 58 | |||
4252 | 59 | The recipe follows the same strong code development coding principles | ||
4253 | 60 | as many other projects: | ||
4254 | 61 | |||
4255 | 62 | * Style enforcement : we follow the PEP8 guidelines | ||
4256 | 63 | * Static analysis with `flake8 <https://pypi.python.org/pypi/flake8>`_ | ||
4257 | 64 | (combines conveniently `pep8 <https://pypi.python.org/pypi/pep8>`_ | ||
4258 | 65 | and `pyflakes <https://pypi.python.org/pypi/pyflakes>`_). | ||
4259 | 66 | * Unit tests : we try and test as much as possible. It is hard to achieve a | ||
4260 | 67 | real 100% with a tool that calls so many external processes, but | ||
4261 | 68 | this is mitigated by our | ||
4262 | 69 | :ref:`continuous integration <continuous_integration>` practice of | ||
4263 | 70 | doing real OpenERP installations with the latest revision of the recipe. | ||
4264 | 71 | |||
4265 | 72 | Launching static analysis and unit tests | ||
4266 | 73 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
4267 | 74 | |||
4268 | 75 | Install ``nose``, ``flake8`` and, optionally, ``coverage``:: | ||
4269 | 76 | |||
4270 | 77 | recipe-env/bin/pip install nose coverage flake8==2.0 \ | ||
4271 | 78 | pep8=1.4.6 mccabe==0.2.1 pyflakes==0.7.3 nose | ||
4272 | 79 | |||
4273 | 80 | |||
4274 | 81 | .. note:: we've had problems lately with discrepancies in ``pep8`` | ||
4275 | 82 | versions, that's why versions of ``flake8`` and its | ||
4276 | 83 | dependencies are fixed above. In case of doubt, check what | ||
4277 | 84 | the buildbot is actually running. | ||
4278 | 85 | |||
4279 | 86 | Run ``flake8`` and the tests:: | ||
4280 | 87 | |||
4281 | 88 | cd anybox.recipe.openerp | ||
4282 | 89 | flake8 anybox && nosetests anybox --with-doctest | ||
4283 | 90 | |||
4284 | 91 | There is also this convenience to run the tests and output a coverage report:: | ||
4285 | 92 | |||
4286 | 93 | source ./test-cover | ||
4287 | 94 | |||
4288 | 95 | |||
4289 | 96 | .. _integration tests: | ||
4290 | 97 | |||
4291 | 98 | Integration tests | ||
4292 | 99 | ~~~~~~~~~~~~~~~~~ | ||
4293 | 100 | |||
4294 | 101 | There is a special category of tests: those that need a real OpenERP | ||
4295 | 102 | instance, built with the recipe, to run. | ||
4296 | 103 | |||
4297 | 104 | They are located within the ``tests_with_openerp`` subdirectory and | ||
4298 | 105 | need to be launched with a launcher script constructed by the recipe. | ||
4299 | 106 | |||
4300 | 107 | For example, create a testing buildout like this:: | ||
4301 | 108 | |||
4302 | 109 | [openerp] | ||
4303 | 110 | # version as you wish | ||
4304 | 111 | eggs = nose | ||
4305 | 112 | openerp_scripts nosetests command-line-options = -d | ||
4306 | 113 | |||
4307 | 114 | Then run ``bin/buildout``, create a database and initialize it. From | ||
4308 | 115 | the buildout directory:: | ||
4309 | 116 | |||
4310 | 117 | createdb test-recipe | ||
4311 | 118 | bin/start_openerp -d test-recipe -i base --stop-after-init | ||
4312 | 119 | |||
4313 | 120 | You can then run the tests:: | ||
4314 | 121 | |||
4315 | 122 | bin/nosetests_openerp -d test-recipe -- /path/to/recipe/branch/tests_with_openerp | ||
4316 | 123 | |||
4317 | 124 | Currently, these tests are all about the ``Session`` objects, used in | ||
4318 | 125 | scripts. | ||
4319 | 126 | |||
4320 | 127 | .. note:: you may use a different version of the recipe to build that | ||
4321 | 128 | testing buildout. This is anyway what happens if you build | ||
4322 | 129 | with your development version, and hack some changes | ||
4323 | 130 | afterwards. | ||
4324 | 131 | |||
4325 | 132 | Using a very different version of the recipe could give | ||
4326 | 133 | funky results, but you're supposed to know what you're doing | ||
4327 | 134 | at this point. | ||
4328 | 135 | |||
4329 | 136 | |||
4330 | 137 | .. _continuous_integration: | ||
4331 | 138 | |||
4332 | 139 | Continuous integration | ||
4333 | 140 | ~~~~~~~~~~~~~~~~~~~~~~ | ||
4334 | 141 | |||
4335 | 142 | Basic builds | ||
4336 | 143 | ------------ | ||
4337 | 144 | |||
4338 | 145 | Upon each push on the main branches, Anybox' public | ||
4339 | 146 | buildbot awakes to check the coding style, run the tests and build | ||
4340 | 147 | this documentation. You may check the status there: | ||
4341 | 148 | |||
4342 | 149 | * `trunk builder | ||
4343 | 150 | <http://buildbot.anybox.fr/waterfall?show=anybox.recipe.openerp>`_ | ||
4344 | 151 | * `stable builder | ||
4345 | 152 | <http://buildbot.anybox.fr/waterfall?show=anybox.recipe.openerp-stable>`_ | ||
4346 | 153 | |||
4347 | 154 | Actual runs | ||
4348 | 155 | ----------- | ||
4349 | 156 | |||
4350 | 157 | Furthermore, this buildbot instance runs `anybox.buildbot.openerp | ||
4351 | 158 | <https://pypi.python.org/pypi/anybox.buildbot.openerp>`_, | ||
4352 | 159 | a buildbot configurator for OpenERP installations based on the recipe. | ||
4353 | 160 | |||
4354 | 161 | This is used in turn to run high-level integration tests, having the | ||
4355 | 162 | latest bzr version of the recipe actually install several combinations | ||
4356 | 163 | of OpenObject server and addons, and run their unit tests. | ||
4357 | 164 | |||
4358 | 165 | The configuration is stored in the ``buildbot`` subdirectory of the | ||
4359 | 166 | recipe trunk branch. It is made of a high level configuration file | ||
4360 | 167 | (``MANIFEST.cfg``) and buildout configuration files. This buildbot | ||
4361 | 168 | instance actually aggregates several such configurations. | ||
4362 | 169 | |||
4363 | 170 | The corresponding builders are those whose name starts with | ||
4364 | 171 | ``recipe-`` or ``stable-recipe-`` in the `builders list | ||
4365 | 172 | <http://buildbot.anybox.fr/builders>`_. | ||
4366 | 173 | |||
4367 | 174 | .. note:: the `integration tests`_ mentioned above are executed in | ||
4368 | 175 | particular during this process, currently in the | ||
4369 | 176 | ``recipe-7.0-postgresql-9.2`` builder. | ||
4370 | 177 | |||
4371 | 178 | Some builds may appear to be broken because of tests failures been | ||
4372 | 179 | pushed by upstream in OpenERP itself or in the tested addons, but it's | ||
4373 | 180 | easy to check whether this is due to a recipe failure or not. | ||
4374 | 181 | |||
4375 | 182 | .. note:: | ||
4376 | 183 | |||
4377 | 184 | Anybox hardware resources are limited; contributing buildslaves would | ||
4378 | 185 | be greatly appreciated. | ||
4379 | 186 | |||
4380 | 187 | |||
4381 | 0 | 188 | ||
4382 | === added file 'doc/dev_prod_workflow.rst' | |||
4383 | --- doc/dev_prod_workflow.rst 1970-01-01 00:00:00 +0000 | |||
4384 | +++ doc/dev_prod_workflow.rst 2014-02-06 07:42:46 +0000 | |||
4385 | @@ -0,0 +1,32 @@ | |||
4386 | 1 | Full development to production example | ||
4387 | 2 | ======================================= | ||
4388 | 3 | |||
4389 | 4 | In this example, we present one way of organizing a project, to | ||
4390 | 5 | provide easy to install development setups, continuous integration and | ||
4391 | 6 | production deployments. | ||
4392 | 7 | |||
4393 | 8 | Please read this as a pattern among many others. If you decide to base | ||
4394 | 9 | your development process on it, you'll have to adapt it to your team's | ||
4395 | 10 | practice anyway. | ||
4396 | 11 | |||
4397 | 12 | Common setup | ||
4398 | 13 | ~~~~~~~~~~~~ | ||
4399 | 14 | |||
4400 | 15 | Developer's setup | ||
4401 | 16 | ~~~~~~~~~~~~~~~~~ | ||
4402 | 17 | Here we add private read-write access to version control systems. | ||
4403 | 18 | We need to version the buildout itself, and make decisions about which | ||
4404 | 19 | addons will be under active development within that project. | ||
4405 | 20 | |||
4406 | 21 | At this point, asking a developer to work on the project is as simple | ||
4407 | 22 | as providing the main URL to get the buildout from VCS. | ||
4408 | 23 | |||
4409 | 24 | Release and packaging | ||
4410 | 25 | ~~~~~~~~~~~~~~~~~~~~~ | ||
4411 | 26 | Use of ``freeze-to``, ``extract-downloads-to``, and production of a tarball. | ||
4412 | 27 | |||
4413 | 28 | Deployment with a server-local configuration file | ||
4414 | 29 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
4415 | 30 | You may decide to track the local files with a VCS, too, but it's | ||
4416 | 31 | preferable to keep it distinct from the main code base. | ||
4417 | 32 | |||
4418 | 0 | 33 | ||
4419 | === added file 'doc/first_steps.rst' | |||
4420 | --- doc/first_steps.rst 1970-01-01 00:00:00 +0000 | |||
4421 | +++ doc/first_steps.rst 2014-02-06 07:42:46 +0000 | |||
4422 | @@ -0,0 +1,351 @@ | |||
4423 | 1 | First steps | ||
4424 | 2 | =========== | ||
4425 | 3 | |||
4426 | 4 | |||
4427 | 5 | .. _howto: | ||
4428 | 6 | |||
4429 | 7 | How to create and bootstrap a buildout | ||
4430 | 8 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
4431 | 9 | |||
4432 | 10 | To create a buildout and run the build, you just need **1 file** and **2 commands**: | ||
4433 | 11 | |||
4434 | 12 | - Create a single ``buildout.cfg`` file. | ||
4435 | 13 | - Be sure you installed all your build dependencies | ||
4436 | 14 | - Bootstrap the buildout with: ``python bootstrap.py`` | ||
4437 | 15 | - Run the build with: ``bin/buildout`` | ||
4438 | 16 | |||
4439 | 17 | The same with more details below : | ||
4440 | 18 | |||
4441 | 19 | Creating the buildout | ||
4442 | 20 | --------------------- | ||
4443 | 21 | |||
4444 | 22 | Create a ``buildout.cfg`` file in an empty directory, containing the | ||
4445 | 23 | configuration of the `example 6.1`_ section. | ||
4446 | 24 | |||
4447 | 25 | .. _dependencies: | ||
4448 | 26 | |||
4449 | 27 | Installing build dependencies | ||
4450 | 28 | ----------------------------- | ||
4451 | 29 | |||
4452 | 30 | You basically need typical development tools needed to build all the Python | ||
4453 | 31 | dependency eggs of OpenERP. You can do this by yourself with your system or | ||
4454 | 32 | Linux distribution. | ||
4455 | 33 | |||
4456 | 34 | Or if you're using a Debian based distribution, we provide a single | ||
4457 | 35 | dependency package you can use to install all dependencies in one shot: | ||
4458 | 36 | |||
4459 | 37 | Add the following line in your ``/etc/apt/sources.list``:: | ||
4460 | 38 | |||
4461 | 39 | deb http://apt.anybox.fr/openerp common main | ||
4462 | 40 | |||
4463 | 41 | If you don't want your system to complain about non-signed packages, | ||
4464 | 42 | have it accept the signing key, e.g. by issuing:: | ||
4465 | 43 | |||
4466 | 44 | sudo apt-key adv --keyserver hkp://subkeys.pgp.net --recv-keys 0xE38CEB07 | ||
4467 | 45 | |||
4468 | 46 | (sometimes, the key server is too busy, you may need to wait a few | ||
4469 | 47 | minutes and try again) | ||
4470 | 48 | |||
4471 | 49 | Install the dependency package:: | ||
4472 | 50 | |||
4473 | 51 | $ sudo aptitude update | ||
4474 | 52 | $ sudo aptitude install openerp-server-system-build-deps | ||
4475 | 53 | |||
4476 | 54 | You can uninstall this package with ``aptitude`` after the build to | ||
4477 | 55 | automatically remove all un-needed dependencies, but you need to | ||
4478 | 56 | install *run dependencies* before that :: | ||
4479 | 57 | |||
4480 | 58 | $ sudo aptitude install openerp-server-system-run-deps | ||
4481 | 59 | $ sudo aptitude remove openerp-server-system-build-deps | ||
4482 | 60 | |||
4483 | 61 | Please note that these package will have your system install the | ||
4484 | 62 | *client* part of PostgreSQL software only. If you want a | ||
4485 | 63 | PostgreSQL server on the same host, that's not in the recipe scope, | ||
4486 | 64 | just install it as well. | ||
4487 | 65 | |||
4488 | 66 | Bootstrapping the buildout | ||
4489 | 67 | -------------------------- | ||
4490 | 68 | Bootstrapping the buildout consists in creating the basic structure of | ||
4491 | 69 | the buildout, and installing buildout itself in the directory. | ||
4492 | 70 | Once it's been done, everything is under tight control. | ||
4493 | 71 | |||
4494 | 72 | The easiest way to bootstrap is to use the ``bootstrap.py`` script:: | ||
4495 | 73 | |||
4496 | 74 | $ wget https://raw.github.com/buildout/buildout/master/bootstrap/bootstrap.py | ||
4497 | 75 | |||
4498 | 76 | As of zc.buildout version 2.2, strong isolation from the system-wide Python | ||
4499 | 77 | installation has been abandoned because of its redundancy with the | ||
4500 | 78 | very popular `virtualenv <https://pypi.python.org/pypi/virtualenv>`_. | ||
4501 | 79 | Besides, the bootstrap actually fails if a version of | ||
4502 | 80 | setuptools older than 0.7 is present system-wide (happens easily | ||
4503 | 81 | enough at the time of this writing). | ||
4504 | 82 | |||
4505 | 83 | The universal current way of doing is therefore to start from a | ||
4506 | 84 | virtualenv *without setuptools*. For virtualenv >= 1.9, just do:: | ||
4507 | 85 | |||
4508 | 86 | $ virtualenv sandbox --no-setuptools | ||
4509 | 87 | |||
4510 | 88 | For older versions of virtualenv:: | ||
4511 | 89 | |||
4512 | 90 | $ virtualenv sandbox | ||
4513 | 91 | $ sandbox/bin/pip uninstall setuptools pip | ||
4514 | 92 | |||
4515 | 93 | .. note:: to install virtualenv. | ||
4516 | 94 | |||
4517 | 95 | * Debian family: sudo aptitude install python-virtualenv | ||
4518 | 96 | * Redhat/Fedora/CenOS family: sudo yum install python-virtualenv | ||
4519 | 97 | |||
4520 | 98 | Finally, perform the bootstrap with the virtualenv's Python:: | ||
4521 | 99 | |||
4522 | 100 | $ sandbox/bin/python bootstrap.py | ||
4523 | 101 | |||
4524 | 102 | From now on, all buildout related operations, including OpenERP | ||
4525 | 103 | startup script, custom scripts will be protected by this virtualenv. | ||
4526 | 104 | |||
4527 | 105 | .. note:: nothing, not even ``zc.buildout`` actually gets installed by | ||
4528 | 106 | buildout in such a virtualenv. | ||
4529 | 107 | It's *totally safe* if you're managing several buildouts to | ||
4530 | 108 | share a single such virtualenv among all of them. | ||
4531 | 109 | |||
4532 | 110 | .. note:: since the bootstrap operation is so sensitive, we recommend | ||
4533 | 111 | package managers to include the precise ``bootstrap.py`` in | ||
4534 | 112 | their distributed buildout, and to bundle a future-proof | ||
4535 | 113 | shell script, using options such as ``-v``. | ||
4536 | 114 | |||
4537 | 115 | |||
4538 | 116 | Running the build | ||
4539 | 117 | ----------------- | ||
4540 | 118 | |||
4541 | 119 | Just run :: | ||
4542 | 120 | |||
4543 | 121 | $ bin/buildout | ||
4544 | 122 | |||
4545 | 123 | Starting OpenERP | ||
4546 | 124 | ---------------- | ||
4547 | 125 | |||
4548 | 126 | Just run :: | ||
4549 | 127 | |||
4550 | 128 | $ bin/start_openerp | ||
4551 | 129 | |||
4552 | 130 | .. _example 7.0: | ||
4553 | 131 | |||
4554 | 132 | Example OpenERP 7.0 buildouts | ||
4555 | 133 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
4556 | 134 | This example builds the latest nightly OpenERP 7 version. | ||
4557 | 135 | Note how most Python distribution versions are pinned. | ||
4558 | 136 | |||
4559 | 137 | While not mandatory, version pinning is an | ||
4560 | 138 | important part of the buildout culture. Note also how even ``zc.buildout`` | ||
4561 | 139 | and the current recipe versions can be pinned:: | ||
4562 | 140 | |||
4563 | 141 | [buildout] | ||
4564 | 142 | parts = openerp | ||
4565 | 143 | versions = versions | ||
4566 | 144 | find-links = http://download.gna.org/pychart/ | ||
4567 | 145 | |||
4568 | 146 | [openerp] | ||
4569 | 147 | recipe = anybox.recipe.openerp[bzr]:server | ||
4570 | 148 | version = nightly 7.0 latest | ||
4571 | 149 | |||
4572 | 150 | [versions] | ||
4573 | 151 | setuptools = 1.1.0 | ||
4574 | 152 | zc.buildout = 2.2.1 | ||
4575 | 153 | zc.recipe.eggs = 2.0.0 | ||
4576 | 154 | anybox.recipe.openerp = 1.7.1 | ||
4577 | 155 | babel = 0.9.6 | ||
4578 | 156 | Pillow = 1.7.1 | ||
4579 | 157 | pywebdav = 0.9.4.1 | ||
4580 | 158 | PyXML = 0.8.4 | ||
4581 | 159 | pyyaml = 3.10 | ||
4582 | 160 | werkzeug = 0.8.3 | ||
4583 | 161 | zsi = 2.0-rc3 | ||
4584 | 162 | feedparser = 5.1.1 | ||
4585 | 163 | gdata = 2.0.16 | ||
4586 | 164 | lxml = 2.3.3 | ||
4587 | 165 | psycopg2 = 2.4.4 | ||
4588 | 166 | pydot = 1.0.28 | ||
4589 | 167 | pyparsing = 1.5.6 | ||
4590 | 168 | python-dateutil = 1.5 | ||
4591 | 169 | python-ldap = 2.4.9 | ||
4592 | 170 | python-openid = 2.2.5 | ||
4593 | 171 | pytz = 2012b | ||
4594 | 172 | vatnumber = 1.0 | ||
4595 | 173 | vobject = 0.8.1c | ||
4596 | 174 | xlwt = 0.7.3 | ||
4597 | 175 | |||
4598 | 176 | Of course, installing the latest nightly release provided by OpenERP | ||
4599 | 177 | is not really interesting. The flexibility is. | ||
4600 | 178 | |||
4601 | 179 | Here's an example with the latest versions of the 7.0 Bazaar branches | ||
4602 | 180 | on Launchpad as lightweight checkouts (to avoid hour long downloads). | ||
4603 | 181 | We don't repeat the ``buildout`` and ``versions`` sections:: | ||
4604 | 182 | |||
4605 | 183 | [openerp] | ||
4606 | 184 | recipe = anybox.recipe.openerp[bzr]:server | ||
4607 | 185 | version = bzr lp:openobject-server/7.0 openerp-7.0 last:1 bzr-init=lightweight-checkout | ||
4608 | 186 | addons = bzr lp:openobject-addons/7.0 addons-7.0 last:1 bzr-init=lightweight-checkout | ||
4609 | 187 | bzr lp:openerp-web/7.0 addons-web-7.0 last:1 subdir=addons bzr-init=lightweight-checkout | ||
4610 | 188 | |||
4611 | 189 | Now imagine how easily one can switch branches and redistribute a | ||
4612 | 190 | ready-to-run buildout on some dedicated support branch, Git mirrors, etc. | ||
4613 | 191 | |||
4614 | 192 | The next example is on 6.1 and demonstrates both how to add specific addons | ||
4615 | 193 | directories, and how uniform it is. | ||
4616 | 194 | |||
4617 | 195 | .. _example 6.1: | ||
4618 | 196 | |||
4619 | 197 | Example OpenERP 6.1 buildout with a custom addon | ||
4620 | 198 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
4621 | 199 | |||
4622 | 200 | Here is a very simple example for a latest OpenERP 6.1 nightly and a | ||
4623 | 201 | custom addon hosted on Bitbucket:: | ||
4624 | 202 | |||
4625 | 203 | [buildout] | ||
4626 | 204 | parts = openerp | ||
4627 | 205 | versions = versions | ||
4628 | 206 | find-links = http://download.gna.org/pychart/ | ||
4629 | 207 | |||
4630 | 208 | [openerp] | ||
4631 | 209 | recipe = anybox.recipe.openerp:server | ||
4632 | 210 | version = nightly 6.1 latest | ||
4633 | 211 | addons = hg https://bitbucket.org/anybox/anytracker addons-at default | ||
4634 | 212 | |||
4635 | 213 | [versions] | ||
4636 | 214 | MarkupSafe = 0.15 | ||
4637 | 215 | Pillow = 1.7.7 | ||
4638 | 216 | PyXML = 0.8.4 | ||
4639 | 217 | babel = 0.9.6 | ||
4640 | 218 | feedparser = 5.1.1 | ||
4641 | 219 | gdata = 2.0.16 | ||
4642 | 220 | lxml = 2.3.3 | ||
4643 | 221 | mako = 0.6.2 | ||
4644 | 222 | psycopg2 = 2.4.4 | ||
4645 | 223 | pychart = 1.39 | ||
4646 | 224 | pydot = 1.0.28 | ||
4647 | 225 | pyparsing = 1.5.6 | ||
4648 | 226 | python-dateutil = 1.5 | ||
4649 | 227 | python-ldap = 2.4.9 | ||
4650 | 228 | python-openid = 2.2.5 | ||
4651 | 229 | pytz = 2012b | ||
4652 | 230 | pywebdav = 0.9.4.1 | ||
4653 | 231 | pyyaml = 3.10 | ||
4654 | 232 | reportlab = 2.5 | ||
4655 | 233 | simplejson = 2.4.0 | ||
4656 | 234 | vatnumber = 1.0 | ||
4657 | 235 | vobject = 0.8.1c | ||
4658 | 236 | werkzeug = 0.8.3 | ||
4659 | 237 | xlwt = 0.7.3 | ||
4660 | 238 | zc.buildout = 1.5.2 | ||
4661 | 239 | zc.recipe.egg = 1.3.2 | ||
4662 | 240 | zsi = 2.0-rc3 | ||
4663 | 241 | |||
4664 | 242 | |||
4665 | 243 | .. note:: with OpenERP 6.1 the web client is natively included in the server as a | ||
4666 | 244 | simple module. In that case you don't need to write a separate part for the web | ||
4667 | 245 | client, unless that's what you really want to do. | ||
4668 | 246 | |||
4669 | 247 | |||
4670 | 248 | Example OpenERP 6.0 buildout (server and clients) | ||
4671 | 249 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
4672 | 250 | |||
4673 | 251 | Here is a sample buildout with version specification, 2 OpenERP servers (with | ||
4674 | 252 | one using the latest 6.0 branch on the launchpad) using only NETRPC and | ||
4675 | 253 | listening on 2 different ports, and 2 web clients:: | ||
4676 | 254 | |||
4677 | 255 | [buildout] | ||
4678 | 256 | parts = openerp1 web1 openerp2 web2 | ||
4679 | 257 | #allow-picked-versions = false | ||
4680 | 258 | versions = versions | ||
4681 | 259 | find-links = http://download.gna.org/pychart/ | ||
4682 | 260 | |||
4683 | 261 | [openerp1] | ||
4684 | 262 | recipe = anybox.recipe.openerp:server | ||
4685 | 263 | version = 6.0.3 | ||
4686 | 264 | options.xmlrpc = False | ||
4687 | 265 | options.xmlrpcs = False | ||
4688 | 266 | |||
4689 | 267 | [web1] | ||
4690 | 268 | recipe = anybox.recipe.openerp:webclient | ||
4691 | 269 | version = 6.0.3 | ||
4692 | 270 | |||
4693 | 271 | [openerp2] | ||
4694 | 272 | recipe = anybox.recipe.openerp[bzr]:server | ||
4695 | 273 | version = bzr lp:openobject-server/6.0 openobject-server-6.x last:1 | ||
4696 | 274 | |||
4697 | 275 | options.xmlrpc = False | ||
4698 | 276 | options.xmlrpcs = False | ||
4699 | 277 | options.netrpc_port = 8170 | ||
4700 | 278 | |||
4701 | 279 | [web2] | ||
4702 | 280 | recipe = anybox.recipe.openerp:webclient | ||
4703 | 281 | version = 6.0.3 | ||
4704 | 282 | global.openerp.server.port = '8170' | ||
4705 | 283 | global.server.socket_port = 8180 | ||
4706 | 284 | |||
4707 | 285 | [versions] | ||
4708 | 286 | MarkupSafe = 0.15 | ||
4709 | 287 | Pillow = 1.7.7 | ||
4710 | 288 | anybox.recipe.openerp = 0.9 | ||
4711 | 289 | caldav = 0.1.10 | ||
4712 | 290 | collective.recipe.cmd = 0.5 | ||
4713 | 291 | coverage = 3.5 | ||
4714 | 292 | distribute = 0.6.25 | ||
4715 | 293 | feedparser = 5.0.1 | ||
4716 | 294 | lxml = 2.1.5 | ||
4717 | 295 | mako = 0.4.2 | ||
4718 | 296 | nose = 1.1.2 | ||
4719 | 297 | psycopg2 = 2.4.2 | ||
4720 | 298 | pychart = 1.39 | ||
4721 | 299 | pydot = 1.0.25 | ||
4722 | 300 | pyparsing = 1.5.6 | ||
4723 | 301 | python-dateutil = 1.5 | ||
4724 | 302 | pytz = 2012b | ||
4725 | 303 | pywebdav = 0.9.4.1 | ||
4726 | 304 | pyyaml = 3.10 | ||
4727 | 305 | reportlab = 2.5 | ||
4728 | 306 | vobject = 0.8.1c | ||
4729 | 307 | z3c.recipe.scripts = 1.0.1 | ||
4730 | 308 | zc.buildout = 1.5.2 | ||
4731 | 309 | zc.recipe.egg = 1.3.2 | ||
4732 | 310 | Babel = 0.9.6 | ||
4733 | 311 | FormEncode = 1.2.4 | ||
4734 | 312 | simplejson = 2.1.6 | ||
4735 | 313 | |||
4736 | 314 | Continuously tested examples | ||
4737 | 315 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
4738 | 316 | |||
4739 | 317 | Other examples are available in the ``buildbot`` subdirectory of the | ||
4740 | 318 | source distribution archive of this recipe (the ``tar.gz`` file that | ||
4741 | 319 | can be downloaded `from the PyPI | ||
4742 | 320 | <http://pypi.python.org/pypi/anybox.recipe.openerp>`_), and are | ||
4743 | 321 | continuously tested in the | ||
4744 | 322 | `anybox buildbot <http://buildbot.anybox.fr/>`_ which is powered by | ||
4745 | 323 | `anybox.buildbot.openerp | ||
4746 | 324 | <http://pypi.python.org/pypi/anybox.buildbot.openerp>`_. | ||
4747 | 325 | |||
4748 | 326 | See also :ref:`continuous_integration` for more details about these | ||
4749 | 327 | tested examples. | ||
4750 | 328 | |||
4751 | 329 | Other sample buildouts | ||
4752 | 330 | ~~~~~~~~~~~~~~~~~~~~~~ | ||
4753 | 331 | |||
4754 | 332 | Here are a few ready-to-use buildouts: | ||
4755 | 333 | |||
4756 | 334 | (Be sure to install system dependencies_ first) | ||
4757 | 335 | |||
4758 | 336 | OpenERP with the development branches of the Magento connector addons:: | ||
4759 | 337 | |||
4760 | 338 | $ hg clone https://bitbucket.org/anybox/openerp_connect_magento_buildout | ||
4761 | 339 | $ cd openerp_connect_magento_buildout | ||
4762 | 340 | $ python bootstrap.py | ||
4763 | 341 | $ bin/buildout | ||
4764 | 342 | $ bin/start_openerp | ||
4765 | 343 | |||
4766 | 344 | OpenERP with the development branches of the Prestashop connector addons:: | ||
4767 | 345 | |||
4768 | 346 | $ hg clone https://bitbucket.org/anybox/openerp_connect_prestashop_buildout | ||
4769 | 347 | $ cd openerp_connect_prestashop_buildout | ||
4770 | 348 | $ python bootstrap.py | ||
4771 | 349 | $ bin/buildout | ||
4772 | 350 | $ bin/start_openerp | ||
4773 | 351 | |||
4774 | 0 | 352 | ||
4775 | === added file 'doc/index.rst' | |||
4776 | --- doc/index.rst 1970-01-01 00:00:00 +0000 | |||
4777 | +++ doc/index.rst 2014-02-06 07:42:46 +0000 | |||
4778 | @@ -0,0 +1,79 @@ | |||
4779 | 1 | .. OpenERP buildout recipe documentation master file, created by | ||
4780 | 2 | sphinx-quickstart on Wed Jul 24 18:32:19 2013. | ||
4781 | 3 | You can adapt this file completely to your liking, but it should at least | ||
4782 | 4 | contain the root `toctree` directive. | ||
4783 | 5 | |||
4784 | 6 | OpenERP buildout recipe | ||
4785 | 7 | ======================= | ||
4786 | 8 | |||
4787 | 9 | This recipe for `Buildout <https://github.com/buildout/buildout>`_ is | ||
4788 | 10 | a fully featured tool allowing you to define and deploy quickly | ||
4789 | 11 | OpenERP installations of any kinds, ranging from development setups to | ||
4790 | 12 | fully automated production deployments or continuous integration. | ||
4791 | 13 | |||
4792 | 14 | Some of its main features include: | ||
4793 | 15 | |||
4794 | 16 | * uniformity across OpenERP versions (from 5.0 onwards) | ||
4795 | 17 | * installation of OpenERP server and, if meaningful, GTK and web clients. | ||
4796 | 18 | * retrieval of main software and addons from various sources, | ||
4797 | 19 | including the major version control systems | ||
4798 | 20 | * ability to pinpoint everything for replayability | ||
4799 | 21 | * management of OpenERP configuration | ||
4800 | 22 | * dedicated scripts creation for easy integration of external tools, | ||
4801 | 23 | such as test launchers | ||
4802 | 24 | * packaging: creation of self-contained equivalents for easy | ||
4803 | 25 | deployment in tightly controlled hosting environmenents. | ||
4804 | 26 | |||
4805 | 27 | All these to be considered together with zc.buildout‘s general | ||
4806 | 28 | properties, such as an extensible configuration file format for easy | ||
4807 | 29 | variation or separation of concerns, native Python distributions | ||
4808 | 30 | installation, and of course the huge ecosystem of other recipes. | ||
4809 | 31 | |||
4810 | 32 | About this documentation | ||
4811 | 33 | ------------------------ | ||
4812 | 34 | |||
4813 | 35 | The full documentation is written with `Sphinx | ||
4814 | 36 | <http://sphinx-doc.org>`_, built continuously and | ||
4815 | 37 | uploaded to http://docs.anybox.fr/anybox.recipe.openerp/trunk by Anybox' public | ||
4816 | 38 | buildbot. | ||
4817 | 39 | The Sphinx source tree is to be found under the ``doc`` subdirectory | ||
4818 | 40 | of this project. | ||
4819 | 41 | |||
4820 | 42 | Although this Sphinx documentation started with version 1.8.0, most of | ||
4821 | 43 | its contents applies to the 1.7 series: features introduced with 1.8 | ||
4822 | 44 | are highlighted, and readers may consult the `changelog on PyPI | ||
4823 | 45 | <https://pypi.python.org/pypi/anybox.recipe.openerp#changes>`_. | ||
4824 | 46 | |||
4825 | 47 | We plan to upload released versions of the documentation to | ||
4826 | 48 | http://pythonhosted.org | ||
4827 | 49 | |||
4828 | 50 | Contents | ||
4829 | 51 | -------- | ||
4830 | 52 | |||
4831 | 53 | .. toctree:: | ||
4832 | 54 | :maxdepth: 2 | ||
4833 | 55 | :glob: | ||
4834 | 56 | |||
4835 | 57 | first_steps | ||
4836 | 58 | configuration | ||
4837 | 59 | scripts | ||
4838 | 60 | dev_prod_workflow | ||
4839 | 61 | contributing | ||
4840 | 62 | |||
4841 | 63 | Code documentation | ||
4842 | 64 | ------------------ | ||
4843 | 65 | |||
4844 | 66 | .. toctree:: | ||
4845 | 67 | :maxdepth: 1 | ||
4846 | 68 | :glob: | ||
4847 | 69 | |||
4848 | 70 | apidoc/anybox* | ||
4849 | 71 | |||
4850 | 72 | |||
4851 | 73 | Indices and tables | ||
4852 | 74 | ------------------ | ||
4853 | 75 | |||
4854 | 76 | * :ref:`genindex` | ||
4855 | 77 | * :ref:`modindex` | ||
4856 | 78 | * :ref:`search` | ||
4857 | 79 | |||
4858 | 0 | 80 | ||
4859 | === added file 'doc/scripts.rst' | |||
4860 | --- doc/scripts.rst 1970-01-01 00:00:00 +0000 | |||
4861 | +++ doc/scripts.rst 2014-02-06 07:42:46 +0000 | |||
4862 | @@ -0,0 +1,471 @@ | |||
4863 | 1 | OpenERP Scripts | ||
4864 | 2 | =============== | ||
4865 | 3 | |||
4866 | 4 | The server recipe actually includes a general engine to install Python | ||
4867 | 5 | code that needs access to the OpenERP API and build | ||
4868 | 6 | configuration-aware executables. | ||
4869 | 7 | |||
4870 | 8 | As usual, it tries and do so by bridging the standard Python packaging | ||
4871 | 9 | practice (setuptools-style console scripts, as in | ||
4872 | 10 | ``zc.recipe.egg:scripts``) and OpenERP specificities. | ||
4873 | 11 | |||
4874 | 12 | We call such scripts *OpenERP scripts* to distinguish them among the | ||
4875 | 13 | more general concept of console scripts. | ||
4876 | 14 | |||
4877 | 15 | .. warning:: OpenERP scripts are currently supported for OpenERP ≥ 6.1 only. | ||
4878 | 16 | |||
4879 | 17 | |||
4880 | 18 | Use cases | ||
4881 | 19 | ~~~~~~~~~ | ||
4882 | 20 | |||
4883 | 21 | OpenERP scripts can do great in situations where an RPC script might | ||
4884 | 22 | not be powerful enough or not practical. Some examples: | ||
4885 | 23 | |||
4886 | 24 | * specific batch jobs, especially for large databases (you get to | ||
4887 | 25 | control the transaction). | ||
4888 | 26 | * introspection tools. | ||
4889 | 27 | * general-purposes test launchers that don't have any knowledge of | ||
4890 | 28 | OpenERP specifics, such as ``nose``. See :ref:`command_line_options` | ||
4891 | 29 | for details about that. | ||
4892 | 30 | |||
4893 | 31 | OpenERP vs RPC scripts for administrative tasks | ||
4894 | 32 | ----------------------------------------------- | ||
4895 | 33 | |||
4896 | 34 | There are several Python distributions that wrap the OpenERP RPC APIs | ||
4897 | 35 | for easy use within Python code. | ||
4898 | 36 | |||
4899 | 37 | Using an RPC script for administrative tasks usually leads to | ||
4900 | 38 | wrap it in a shell script, with the admin password in clear text. | ||
4901 | 39 | |||
4902 | 40 | In this author's experience of applicative maintainance, | ||
4903 | 41 | this always turns to be an | ||
4904 | 42 | easy source of breakage that may look to be trivial at first sight but | ||
4905 | 43 | has actually two nasty properties : it may stay unnoticed for a while, | ||
4906 | 44 | and it lies at the interface between responsibilities. | ||
4907 | 45 | |||
4908 | 46 | In case of password change, the persons who can do it | ||
4909 | 47 | in the database and in the system usually differ, and may not | ||
4910 | 48 | communicate on a regular basis. In enterprise hosting environments, | ||
4911 | 49 | you may have to explain stuff to several project managers with | ||
4912 | 50 | different responsabilities, go through crisis management meetings, | ||
4913 | 51 | etc. Who wants to waste hours of their life interacting with people | ||
4914 | 52 | under stress to try and persuade them that it's only a matter of | ||
4915 | 53 | changing an obscure password ? | ||
4916 | 54 | |||
4917 | 55 | |||
4918 | 56 | OpenERP scripts vs Openerp cron jobs | ||
4919 | 57 | ------------------------------------ | ||
4920 | 58 | |||
4921 | 59 | Because they are part of addons, OpenERP cron jobs also have full | ||
4922 | 60 | unrestricted access to the internal API, and obviously don't suffer | ||
4923 | 61 | from the password plague. | ||
4924 | 62 | |||
4925 | 63 | Some ideas to make a choice: | ||
4926 | 64 | |||
4927 | 65 | * who should control, schedule and tune execution (a system administrator or | ||
4928 | 66 | a functional admin) | ||
4929 | 67 | * which one the script author finds easiest to write for | ||
4930 | 68 | * reuse and distribution issues : OpenERP scripts are in Python | ||
4931 | 69 | distributions, cron jobs are in addons. | ||
4932 | 70 | * OpenERP scripts must implement their own transaction control, | ||
4933 | 71 | whereas cron jobs don't bother about it but rely on the framework's | ||
4934 | 72 | decisions. | ||
4935 | 73 | |||
4936 | 74 | Perhaps, the best is not to choose : put the bulk of the logic in some | ||
4937 | 75 | technical addon, it's easy to rewrap it in an OpenERP script and as a | ||
4938 | 76 | cron job. | ||
4939 | 77 | |||
4940 | 78 | |||
4941 | 79 | Declaring OpenERP Scripts | ||
4942 | 80 | ~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
4943 | 81 | There are several cases, depending on the script authors | ||
4944 | 82 | intentions. Script authors should therefore state clearly in their | ||
4945 | 83 | documentation how to declare them. | ||
4946 | 84 | |||
4947 | 85 | Assume to fix ideas there is a Python distribution ``my.script`` | ||
4948 | 86 | that declares a console script entry point named ``my_script`` in its | ||
4949 | 87 | ``setup.py``:: | ||
4950 | 88 | |||
4951 | 89 | entry_points=""" | ||
4952 | 90 | |||
4953 | 91 | [console_scripts] | ||
4954 | 92 | my_script = my.script.main:run | ||
4955 | 93 | """ | ||
4956 | 94 | |||
4957 | 95 | The first thing to do is to require that distribution using the | ||
4958 | 96 | ``eggs`` option:: | ||
4959 | 97 | |||
4960 | 98 | [my-openerp] | ||
4961 | 99 | (...) | ||
4962 | 100 | eggs = my.script | ||
4963 | 101 | |||
4964 | 102 | :ref:`How that distribution can be made available to buildout | ||
4965 | 103 | <making_available>` is a different question. | ||
4966 | 104 | |||
4967 | 105 | Bare declararations | ||
4968 | 106 | ------------------- | ||
4969 | 107 | The following configuration:: | ||
4970 | 108 | |||
4971 | 109 | [openerp-one] | ||
4972 | 110 | (...) | ||
4973 | 111 | openerp_scripts = my_script | ||
4974 | 112 | |||
4975 | 113 | Produces an executable ``bin/my_script-openerp-one``, that can import | ||
4976 | 114 | OpenERP server and addons code, and in which the OpenERP configuration | ||
4977 | 115 | related to the appropriate buildout part (here, ``openerp-one``) is | ||
4978 | 116 | loaded in the standard ``openerp.tools.config``, for use in the | ||
4979 | 117 | script. The script has to take care of all database management operations. | ||
4980 | 118 | |||
4981 | 119 | Optionally, it's possible to specify the name of the produced script:: | ||
4982 | 120 | |||
4983 | 121 | [openerp-one] | ||
4984 | 122 | (...) | ||
4985 | 123 | openerp_scripts = my_script=wished_name | ||
4986 | 124 | |||
4987 | 125 | That would build the script as ``bin/wished_name``. | ||
4988 | 126 | |||
4989 | 127 | This is good | ||
4990 | 128 | enough for scripts that'd take care of many bootstrapping details, but | ||
4991 | 129 | there is a more integrated way that script authors should be aware of: | ||
4992 | 130 | the special ``session`` argument. | ||
4993 | 131 | |||
4994 | 132 | .. _arguments_session: | ||
4995 | 133 | |||
4996 | 134 | Arguments and session | ||
4997 | 135 | --------------------- | ||
4998 | 136 | .. note:: new in version 1.7.0 | ||
4999 | 137 | |||
5000 | 138 | An ``arguments`` parameter, similar to the one of |
The diff has been truncated for viewing.