summaryrefslogtreecommitdiffstats
path: root/Lib/packaging/pypi
diff options
context:
space:
mode:
authorTarek Ziade <tarek@ziade.org>2011-05-30 10:07:49 (GMT)
committerTarek Ziade <tarek@ziade.org>2011-05-30 10:07:49 (GMT)
commitb1b6e1384cf180657e8301643a4563077183a9e4 (patch)
tree9ba33451b79908d89a8207b1d7b3fa2d3bb59a03 /Lib/packaging/pypi
parent43f289ad8882a743d03b92a430f7ab7616e96673 (diff)
downloadcpython-b1b6e1384cf180657e8301643a4563077183a9e4.zip
cpython-b1b6e1384cf180657e8301643a4563077183a9e4.tar.gz
cpython-b1b6e1384cf180657e8301643a4563077183a9e4.tar.bz2
Cleaned up the installer output behavior.
This change also makes sure the logger handlers are not alterated after an installation. That also fixes the remaining environment alteration issue in test_packaging.
Diffstat (limited to 'Lib/packaging/pypi')
-rw-r--r--Lib/packaging/pypi/simple.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/Lib/packaging/pypi/simple.py b/Lib/packaging/pypi/simple.py
index ee7a113..983d477 100644
--- a/Lib/packaging/pypi/simple.py
+++ b/Lib/packaging/pypi/simple.py
@@ -118,9 +118,10 @@ class Crawler(BaseClient):
def __init__(self, index_url=DEFAULT_SIMPLE_INDEX_URL, prefer_final=False,
prefer_source=True, hosts=DEFAULT_HOSTS,
follow_externals=False, mirrors_url=None, mirrors=None,
- timeout=SOCKET_TIMEOUT, mirrors_max_tries=0):
+ timeout=SOCKET_TIMEOUT, mirrors_max_tries=0, verbose=False):
super(Crawler, self).__init__(prefer_final, prefer_source)
self.follow_externals = follow_externals
+ self.verbose = verbose
# mirroring attributes.
parsed = urllib.parse.urlparse(index_url)
@@ -184,7 +185,7 @@ class Crawler(BaseClient):
if predicate.name.lower() in self._projects and not force_update:
return self._projects.get(predicate.name.lower())
prefer_final = self._get_prefer_final(prefer_final)
- logger.info('reading info on PyPI about %s', predicate.name)
+ logger.debug('Reading info on PyPI about %s', predicate.name)
self._process_index_page(predicate.name)
if predicate.name.lower() not in self._projects:
@@ -321,8 +322,9 @@ class Crawler(BaseClient):
infos = get_infos_from_url(link, project_name,
is_external=not self.index_url in url)
except CantParseArchiveName as e:
- logger.warning(
- "version has not been parsed: %s", e)
+ if self.verbose:
+ logger.warning(
+ "version has not been parsed: %s", e)
else:
self._register_release(release_info=infos)
else: