Commit a47b06ad authored by Gary Poster's avatar Gary Poster

push whitespace changes across branches

parent 6107db1f
......@@ -126,7 +126,7 @@ If I need to run a previous version of zc.buildout, I use the
`--version` option of the bootstrap.py script::
$ python bootstrap.py --version 1.1.3
The `zc.buildout project <http://svn.zope.org/zc.buildout/trunk>`_
is a slightly more complex example of this type of buildout.
......
......@@ -495,7 +495,7 @@ class Installer:
if dist is None:
raise zc.buildout.UserError(
"Couln't download distribution %s." % avail)
"Couldn't download distribution %s." % avail)
if dist.precedence == pkg_resources.EGG_DIST:
# It's already an egg, just fetch it into the dest
......@@ -628,9 +628,9 @@ class Installer:
logger.debug('Installing %s.', repr(specs)[1:-1])
path = self._path
dest = self._dest
if dest is not None and dest not in path:
path.insert(0, dest)
destination = self._dest
if destination is not None and destination not in path:
path.insert(0, destination)
requirements = [self._constrain(pkg_resources.Requirement.parse(spec))
for spec in specs]
......@@ -661,7 +661,7 @@ class Installer:
except pkg_resources.DistributionNotFound, err:
[requirement] = err
requirement = self._constrain(requirement)
if dest:
if destination:
logger.debug('Getting required %r', str(requirement))
else:
logger.debug('Adding required %r', str(requirement))
......
......@@ -492,10 +492,14 @@ def _normalize_path(match):
path = path[1:]
return '/' + path.replace(os.path.sep, '/')
if sys.platform == 'win32':
sep = r'[\\/]' # Windows uses both sometimes.
else:
sep = re.escape(os.path.sep)
normalize_path = (
re.compile(
r'''[^'" \t\n\r]+\%(sep)s_[Tt][Ee][Ss][Tt]_\%(sep)s([^"' \t\n\r]+)'''
% dict(sep=os.path.sep)),
r'''[^'" \t\n\r]+%(sep)s_[Tt][Ee][Ss][Tt]_%(sep)s([^"' \t\n\r]+)'''
% dict(sep=sep)),
_normalize_path,
)
......
......@@ -2880,7 +2880,7 @@ def test_suite():
'We have a develop egg: zc.buildout X.X.'),
(re.compile(r'\\[\\]?'), '/'),
(re.compile('WindowsError'), 'OSError'),
(re.compile(r'\[Error 17\] Cannot create a file '
(re.compile(r'\[Error \d+\] Cannot create a file '
r'when that file already exists: '),
'[Errno 17] File exists: '
),
......@@ -2933,6 +2933,7 @@ def test_suite():
(re.compile('extdemo[.]pyd'), 'extdemo.so'),
(re.compile('[-d] setuptools-\S+[.]egg'), 'setuptools.egg'),
(re.compile(r'\\[\\]?'), '/'),
(re.compile(r'\#!\S+\bpython\S*'), '#!/usr/bin/python'),
]+(sys.version_info < (2, 5) and [
(re.compile('.*No module named runpy.*', re.S), ''),
(re.compile('.*usage: pdb.py scriptfile .*', re.S), ''),
......
......@@ -46,7 +46,7 @@ We have a link server that has a number of distributions:
<a href="other-1.0-py2.3.egg">other-1.0-py2.3.egg</a><br>
</body></html>
We have a sample buildout. Let's update it's configuration file to
We have a sample buildout. Let's update its configuration file to
install the demo package.
>>> write(sample_buildout, 'buildout.cfg',
......@@ -187,7 +187,7 @@ Let's add an interpreter option:
... interpreter = py-demo
... """ % dict(server=link_server))
Note that we ommitted the entry point name from the recipe
Note that we omitted the entry point name from the recipe
specification. We were able to do this because the scripts recipe is
the default entry point for the zc.recipe.egg egg.
......
......@@ -15,7 +15,7 @@ To illustrate, we create a sample recipe that is a very thin layer
around the egg recipe:
>>> mkdir(sample_buildout, 'sample')
>>> write(sample_buildout, 'sample', 'sample.py',
>>> write(sample_buildout, 'sample', 'sample.py',
... """
... import logging, os
... import zc.recipe.egg
......@@ -53,7 +53,7 @@ of extra requirements to be included in the working set.
>>> write(sample_buildout, 'sample', 'setup.py',
... """
... from setuptools import setup
...
...
... setup(
... name = "sample",
... entry_points = {'zc.buildout': ['default = sample:Sample']},
......@@ -95,12 +95,13 @@ We can see that the options were augmented with additional data
computed by the egg recipe by looking at .installed.cfg:
>>> cat(sample_buildout, '.installed.cfg')
... # doctest: +NORMALIZE_WHITESPACE
[buildout]
installed_develop_eggs = /sample-buildout/develop-eggs/sample.egg-link
parts = sample-part
<BLANKLINE>
[sample-part]
__buildout_installed__ =
__buildout_installed__ =
__buildout_signature__ = sample-6aWMvV2EJ9Ijq+bR8ugArQ==
zc.recipe.egg-cAsnudgkduAa/Fd+WJIM6Q==
setuptools-0.6-py2.4.egg
......
......@@ -50,7 +50,7 @@ compiler
swig
The path to the swig executable
swig-cpp
swig-cpp
Make SWIG create C++ files (default is C)
swig-opts
......@@ -73,14 +73,14 @@ index
alternate index with this option. If you use the links option and
if the links point to the needed distributions, then the index can
be anything and will be largely ignored. In the examples, here,
we'll just point to an empty directory on our link server. This
we'll just point to an empty directory on our link server. This
will make our examples run a little bit faster.
python
The name of a section to get the Python executable from.
If not specified, then the buildout python option is used. The
Python executable is found in the executable option of the named
section.
section.
environment
The name of a section with additional environment variables. The
......@@ -188,7 +188,7 @@ Let's define a script that uses out ext demo:
...
... [demo]
... recipe = zc.recipe.egg
... eggs = demo
... eggs = demo
... extdemo
... entry-points = demo=demo:main
... """ % dict(server=link_server))
......@@ -270,7 +270,7 @@ We can specify a specific version using the egg option:
...
... [demo]
... recipe = zc.recipe.egg
... eggs = demo
... eggs = demo
... extdemo ==1.4
... entry-points = demo=demo:main
... """ % dict(server=link_server))
......@@ -440,7 +440,7 @@ Create a clean buildout.cfg w/o the checkenv recipe, and delete the recipe:
Uninstalling extdemo.
Installing extdemo.
zip_safe flag not set; analyzing archive contents...
>>> rmdir(sample_buildout, 'recipes')
......@@ -496,7 +496,7 @@ compiler
swig
The path to the swig executable
swig-cpp
swig-cpp
Make SWIG create C++ files (default is C)
swig-opts
......@@ -506,7 +506,7 @@ python
The name of a section to get the Python executable from.
If not specified, then the buildout python option is used. The
Python executable is found in the executable option of the named
section.
section.
To illustrate this, we'll use a directory containing the extdemo
example from the earlier section:
......@@ -532,7 +532,7 @@ example from the earlier section:
...
... [demo]
... recipe = zc.recipe.egg
... eggs = demo
... eggs = demo
... extdemo
... entry-points = demo=demo:main
... """ % dict(extdemo=extdemo))
......
......@@ -24,8 +24,8 @@ We have a link server:
<a href="other-1.0-py2.4.egg">other-1.0-py2.4.egg</a><br>
</body></html>
We have a sample buildout. Let's update it's configuration file to
install the demo package using Python 2.4.
We have a sample buildout. Let's update its configuration file to
install the demo package using Python 2.4.
>>> write(sample_buildout, 'buildout.cfg',
... """
......@@ -69,7 +69,7 @@ we'll get the Python 2.4 eggs for demo and demoneeded:
d setuptools-0.6-py2.4.egg
d setuptools-0.6-py2.5.egg
- zc.buildout-1.0-py2.5.egg
And the generated scripts invoke Python 2.4:
>>> import sys
......
......@@ -36,7 +36,7 @@ def setUp(test):
def setUpSelecting(test):
zc.buildout.testselectingpython.setup(test)
zc.buildout.testing.install_develop('zc.recipe.egg', test)
def test_suite():
suite = unittest.TestSuite((
doctest.DocFileSuite(
......@@ -67,7 +67,7 @@ def test_suite():
'setuptools-\S+\s+'
'zc.buildout-\S+\s*'
),
'__buildout_signature__ = sample- zc.recipe.egg-'),
'__buildout_signature__ = sample- zc.recipe.egg-\n'),
(re.compile('executable = [\S ]+python\S*', re.I),
'executable = python'),
(re.compile('find-links = http://localhost:\d+/'),
......@@ -89,7 +89,7 @@ def test_suite():
(re.compile('extdemo[.]pyd'), 'extdemo.so')
]),
),
))
if sys.version_info[:2] == (2, 5):
......@@ -115,7 +115,7 @@ def test_suite():
]),
),
)
return suite
if __name__ == '__main__':
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment