0

So I'm trying to work through the Plone 4 book and I copied a buildout file (from page 51) that contains the following lines:

[instance]
recipe = plone.recipe.zope2instance
http-address = 8080
user = admin:admin
verbose-security = on
eggs =
${eggs:main}
${eggs:devtools}

# Test runner. Run: ``bin/test`` to execute all tests
PlonePlonebuildout configuration files[test]
recipe = zc.recipe.testrunner
eggs =
${eggs:test}
defaults = ['--auto-color', '--auto-progress']

# Coverage report generator.
# Run: ``bin/test --coverage=coverage`` # and then: ``bin/coveragereport``
[coverage-report]
recipe = zc.recipe.egg
eggs = z3c.coverage
scripts = coveragereport
arguments = ('parts/test/coverage', 'coverage')

When I try to run bin/buildout I get the following error message:

ParsingError: File contains parsing errors: /Users/Jon/dev/pln42/buildout.cfg
    [line 32]: 'PlonePlonebuildout configuration files[test]\n'

I have included some lines that come before and after the line in question so as to provide context. Since I have copied that line directly from the book, I don't know how to change it in order to make the parsing error go away.

(The source code is supposedly available online, but I have tried following the downloading instructions at Packt Publishing and they have not worked.)

Screenshot from my Kindle book:

A screenshot of the code I am trying to follow in the Plone 4 book

tadasajon
  • 14,276
  • 29
  • 92
  • 144

2 Answers2

3

The line PlonePlonebuildout configuration files[test] is clearly wrong; remove everything before the [test] part of that line:

# Test runner. Run: ``bin/test`` to execute all tests
[test]
recipe = zc.recipe.testrunner

Not sure if it is your formatting on Stack Overflow or in your file, but you are also missing some indentation elsewhere:

[instance]
recipe = plone.recipe.zope2instance
http-address = 8080
user = admin:admin
verbose-security = on
eggs =
  ${eggs:main}
  ${eggs:devtools}

The lines following the eggs = specification should be indented to mark them as the (continuing) value for the eggs parameter. The same goes for the eggs = line in the [test] part:

[test]
recipe = zc.recipe.testrunner
eggs =
  ${eggs:test}
defaults = ['--auto-color', '--auto-progress']
Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
  • Thanks. I'm looking at a Kindle version of the book, so maybe it messed up the formatting -- I've added a screenshot. – tadasajon Oct 27 '12 at 21:58
3

Looks like something's gone wrong in the editing/formatting here.

You can find all of my book's source code here: http://github.com/optilude/optilux

Use the branch selector to select a chapter. You can either read it through the web, or clone/download from github.

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
optilude
  • 3,538
  • 3
  • 22
  • 25