[1126] | 1 | from zopeskel.base import BaseTemplate |
---|
| 2 | from zopeskel.base import var |
---|
| 3 | |
---|
[1132] | 4 | class QGPlone3Buildout(BaseTemplate): |
---|
[1138] | 5 | _template_dir = 'templates/qgplone3_buildout' |
---|
[1126] | 6 | summary = "A buildout for Plone 3 projects" |
---|
| 7 | required_templates = [] |
---|
| 8 | use_cheetah = True |
---|
| 9 | |
---|
| 10 | vars = [ |
---|
| 11 | var('plone_version', |
---|
| 12 | "Which Plone version to install", |
---|
| 13 | default="3.2.2"), |
---|
| 14 | var('zope2_install', |
---|
| 15 | 'Path to Zope 2 installation; leave blank to fetch one', |
---|
| 16 | default=''), |
---|
| 17 | var('plone_products_install', |
---|
| 18 | 'Path to directory containing Plone products; leave blank to fetch one', |
---|
| 19 | default=''), |
---|
| 20 | var('zope_user', |
---|
| 21 | 'Zope root admin user', |
---|
| 22 | default='admin'), |
---|
| 23 | var('zope_password', |
---|
| 24 | 'Zope root admin password'), |
---|
| 25 | var('http_port', |
---|
[1131] | 26 | 'HTTP port (development port == http_pot + 10 )', |
---|
[1126] | 27 | default=8080), |
---|
| 28 | ] |
---|
| 29 | |
---|
| 30 | def pre(self, command, output_dir, vars): |
---|
| 31 | vars['oldplone'] = vars['plone_version'].startswith("3.0") or \ |
---|
| 32 | vars['plone_version'].startswith("3.1") |
---|
| 33 | vars['veryoldplone'] = vars['plone_version'].startswith("2.") |
---|
| 34 | if vars['veryoldplone']: |
---|
| 35 | vars['zope2_version'] = "2.9.10" |
---|
| 36 | vars['newplone'] = not vars['veryoldplone'] and not vars['oldplone'] |
---|
[1131] | 37 | vars['http_port_devel'] = vars['http_port'] + 10 |
---|
[1138] | 38 | super(QGPlone3Buildout, self).pre(command, output_dir, vars) |
---|
[1126] | 39 | |
---|
| 40 | def post(self, command, output_dir, vars): |
---|
| 41 | print "-----------------------------------------------------------" |
---|
| 42 | print "Generation finished" |
---|
| 43 | print "You probably want to run python bootstrap.py and then edit" |
---|
| 44 | print "buildout.cfg before running bin/buildout -v" |
---|
| 45 | print |
---|
| 46 | print "See README.txt for details" |
---|
| 47 | print "-----------------------------------------------------------" |
---|
| 48 | |
---|
| 49 | |
---|
| 50 | |
---|