1 | import copy |
---|
2 | from zopeskel import abstract_buildout |
---|
3 | from zopeskel.base import var, EASY, EXPERT |
---|
4 | from zopeskel.plone3_buildout import Plone3Buildout |
---|
5 | from zopeskel.vars import BoundedIntVar |
---|
6 | |
---|
7 | VAR_HTTP_BE1 = BoundedIntVar( |
---|
8 | 'http_port_be1', |
---|
9 | title='Backend1 HTTP Port', |
---|
10 | description="Port that first Backend server will be serving. "\ |
---|
11 | "Other backend' ports increments by 1 from this one.", |
---|
12 | default='20001', |
---|
13 | modes=(EXPERT,EASY), |
---|
14 | page='Main', |
---|
15 | help=""" |
---|
16 | This options lets you select the port # that Zope will use for serving |
---|
17 | HTTP on backnd ZEO clients. |
---|
18 | """, |
---|
19 | min=10000, |
---|
20 | max=65535, |
---|
21 | ) |
---|
22 | |
---|
23 | class QGPlone3Buildout(Plone3Buildout): |
---|
24 | _template_dir = 'templates/qgplone3_buildout' |
---|
25 | summary = "QG Buildout for Plone 3 projects" |
---|
26 | required_templates = [] |
---|
27 | use_cheetah = True |
---|
28 | |
---|
29 | vars = [] |
---|
30 | vars = copy.deepcopy(abstract_buildout.AbstractBuildout.vars) |
---|
31 | vars.extend( |
---|
32 | [ abstract_buildout.VAR_PLONEVER, |
---|
33 | abstract_buildout.VAR_Z2_INSTALL, |
---|
34 | abstract_buildout.VAR_PLONE_PRODUCTS, |
---|
35 | abstract_buildout.VAR_ZOPE_USER, |
---|
36 | abstract_buildout.VAR_ZOPE_PASSWD, |
---|
37 | abstract_buildout.VAR_HTTP, |
---|
38 | VAR_HTTP_BE1 |
---|
39 | ] |
---|
40 | ) |
---|
41 | |
---|
42 | def pre(self, command, output_dir, vars): |
---|
43 | vars['oldplone'] = vars['plone_version'].startswith("3.0") or \ |
---|
44 | vars['plone_version'].startswith("3.1") |
---|
45 | vars['veryoldplone'] = vars['plone_version'].startswith("2.") |
---|
46 | if vars['veryoldplone']: |
---|
47 | vars['zope2_version'] = "2.9.12" |
---|
48 | vars['newplone'] = not vars['veryoldplone'] and not vars['oldplone'] |
---|
49 | vars['http_port_devel'] = int(vars['http_port']) + 10 |
---|
50 | super(QGPlone3Buildout, self).pre(command, output_dir, vars) |
---|