[Checkins] SVN: zc.buildout/trunk/ Adjusted the output for verbosity levels. Using a single -v option

Jim Fulton jim at zope.com
Mon Mar 5 07:04:26 EST 2007


Log message for revision 72980:
  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.
  

Changed:
  U   zc.buildout/trunk/CHANGES.txt
  U   zc.buildout/trunk/src/zc/buildout/easy_install.py
  U   zc.buildout/trunk/src/zc/buildout/tests.py

-=-
Modified: zc.buildout/trunk/CHANGES.txt
===================================================================
--- zc.buildout/trunk/CHANGES.txt	2007-03-05 12:04:17 UTC (rev 72979)
+++ zc.buildout/trunk/CHANGES.txt	2007-03-05 12:04:25 UTC (rev 72980)
@@ -17,6 +17,16 @@
 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)
 =====================
 

Modified: zc.buildout/trunk/src/zc/buildout/easy_install.py
===================================================================
--- zc.buildout/trunk/src/zc/buildout/easy_install.py	2007-03-05 12:04:17 UTC (rev 72979)
+++ zc.buildout/trunk/src/zc/buildout/easy_install.py	2007-03-05 12:04:25 UTC (rev 72980)
@@ -127,7 +127,8 @@
     def _satisfied(self, req):
         dists = [dist for dist in self._env[req.project_name] if dist in req]
         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
 
         # Note that dists are sorted from best to worst, as promised by
@@ -144,7 +145,7 @@
             # Environment.__getitem__.
             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.sort()
         maxv = None
@@ -217,9 +218,9 @@
         if self._always_unzip:
             args += ('-Z', )
         level = logger.getEffectiveLevel()
-        if level > logging.DEBUG:
+        if level > 0:
             args += ('-q', )
-        elif level < logging.DEBUG:
+        elif level < 0:
             args += ('-v', )
 
         args += (spec, )
@@ -549,12 +550,12 @@
             ]
 
         log_level = logger.getEffectiveLevel()
-        if log_level <= logging.DEBUG:
-            if log_level == logging.DEBUG:
+        if log_level <= 0:
+            if log_level == 0:
                 del args[1]
             else:
                 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
 

Modified: zc.buildout/trunk/src/zc/buildout/tests.py
===================================================================
--- zc.buildout/trunk/src/zc/buildout/tests.py	2007-03-05 12:04:17 UTC (rev 72979)
+++ zc.buildout/trunk/src/zc/buildout/tests.py	2007-03-05 12:04:25 UTC (rev 72980)
@@ -70,7 +70,7 @@
     ... parts = 
     ... ''')
 
-    >>> print system(join('bin', 'buildout')+' -v'), # doctest: +ELLIPSIS
+    >>> print system(join('bin', 'buildout')+' -vv'), # doctest: +ELLIPSIS
     zc.buildout...
     buildout: Develop: /sample-buildout/foo
     ...
@@ -1206,7 +1206,33 @@
 
 """
 
+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
+    
+    """
+
 ######################################################################
     
 def create_sample_eggs(test, executable=sys.executable):



More information about the Checkins mailing list