Commit da53c58c authored by Jim Fulton's avatar Jim Fulton

Adjusted the output for verbosity levels. Using a single -v option

no longer causes voluminous setuptools output.  Uisng -vv and -vvv
now triggers extra setuptools output.

Improved a logging message.
parent 2413935c
...@@ -17,6 +17,16 @@ priorities include: ...@@ -17,6 +17,16 @@ priorities include:
Change History Change History
************** **************
1.0.0b21 (2007-03-??)
=====================
Feature Changes
---------------
- Adjusted the output for verbosity levels. Using a single -v option
no longer causes voluminous setuptools output. Uisng -vv and -vvv
now triggers extra setuptools output.
1.0.0b20 (2007-02-08) 1.0.0b20 (2007-02-08)
===================== =====================
......
...@@ -127,7 +127,8 @@ class Installer: ...@@ -127,7 +127,8 @@ class Installer:
def _satisfied(self, req): def _satisfied(self, req):
dists = [dist for dist in self._env[req.project_name] if dist in req] dists = [dist for dist in self._env[req.project_name] if dist in req]
if not dists: if not dists:
logger.debug('We have no distributions for %s', req.project_name) logger.debug('We have no distributions for %s that satisfies %s.',
req.project_name, req)
return None return None
# Note that dists are sorted from best to worst, as promised by # Note that dists are sorted from best to worst, as promised by
...@@ -144,7 +145,7 @@ class Installer: ...@@ -144,7 +145,7 @@ class Installer:
# Environment.__getitem__. # Environment.__getitem__.
return dists[0] return dists[0]
# Find an upprt limit in the specs, if there is one: # Find an upper limit in the specs, if there is one:
specs = [(pkg_resources.parse_version(v), op) for (op, v) in req.specs] specs = [(pkg_resources.parse_version(v), op) for (op, v) in req.specs]
specs.sort() specs.sort()
maxv = None maxv = None
...@@ -217,9 +218,9 @@ class Installer: ...@@ -217,9 +218,9 @@ class Installer:
if self._always_unzip: if self._always_unzip:
args += ('-Z', ) args += ('-Z', )
level = logger.getEffectiveLevel() level = logger.getEffectiveLevel()
if level > logging.DEBUG: if level > 0:
args += ('-q', ) args += ('-q', )
elif level < logging.DEBUG: elif level < 0:
args += ('-v', ) args += ('-v', )
args += (spec, ) args += (spec, )
...@@ -549,12 +550,12 @@ def develop(setup, dest, ...@@ -549,12 +550,12 @@ def develop(setup, dest,
] ]
log_level = logger.getEffectiveLevel() log_level = logger.getEffectiveLevel()
if log_level <= logging.DEBUG: if log_level <= 0:
if log_level == logging.DEBUG: if log_level == 0:
del args[1] del args[1]
else: else:
args[1] == '-v' args[1] == '-v'
logger.debug("in: %s\n%r", directory, args) logger.debug("in: %s\n%r", directory, args)
assert os.spawnl(os.P_WAIT, executable, executable, *args) == 0 assert os.spawnl(os.P_WAIT, executable, executable, *args) == 0
......
...@@ -70,7 +70,7 @@ We should be able to deal with setup scripts that aren't setuptools based. ...@@ -70,7 +70,7 @@ We should be able to deal with setup scripts that aren't setuptools based.
... parts = ... parts =
... ''') ... ''')
>>> print system(join('bin', 'buildout')+' -v'), # doctest: +ELLIPSIS >>> print system(join('bin', 'buildout')+' -vv'), # doctest: +ELLIPSIS
zc.buildout... zc.buildout...
buildout: Develop: /sample-buildout/foo buildout: Develop: /sample-buildout/foo
... ...
...@@ -1206,6 +1206,32 @@ uninstall ...@@ -1206,6 +1206,32 @@ uninstall
""" """
def log_when_there_are_not_local_distros():
"""
>>> from zope.testing.loggingsupport import InstalledHandler
>>> handler = InstalledHandler('zc.buildout.easy_install')
>>> import logging
>>> logger = logging.getLogger('zc.buildout.easy_install')
>>> old_propogate = logger.propagate
>>> logger.propagate = False
>>> dest = tmpdir('sample-install')
>>> import zc.buildout.easy_install
>>> ws = zc.buildout.easy_install.install(
... ['demo==0.2'], dest,
... links=[link_server], index=link_server+'index/')
>>> print handler # doctest: +ELLIPSIS
zc.buildout.easy_install DEBUG
Installing ['demo==0.2']
zc.buildout.easy_install DEBUG
We have no distributions for demo that satisfies demo==0.2.
...
>>> handler.uninstall()
>>> logger.propagate = old_propogate
"""
###################################################################### ######################################################################
......
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