summaryrefslogtreecommitdiffstats
path: root/Lib/packaging/pypi/base.py
diff options
context:
space:
mode:
authorÉric Araujo <merwok@netwok.org>2012-06-24 04:07:41 (GMT)
committerÉric Araujo <merwok@netwok.org>2012-06-24 04:07:41 (GMT)
commit859aad6a36262383b98ddd45fe3253a882b87ce8 (patch)
tree1cc50af4fc88c650fe997a2e72f5f26d92a1986c /Lib/packaging/pypi/base.py
parentdc44f55cc9dc1d016799362c344958baab328ff4 (diff)
downloadcpython-859aad6a36262383b98ddd45fe3253a882b87ce8.zip
cpython-859aad6a36262383b98ddd45fe3253a882b87ce8.tar.gz
cpython-859aad6a36262383b98ddd45fe3253a882b87ce8.tar.bz2
Remove packaging from the standard library.
Distutils2 will live on on PyPI and be included in the stdlib when it is ready. See discussion starting at http://mail.python.org/pipermail/python-dev/2012-June/120430.html
Diffstat (limited to 'Lib/packaging/pypi/base.py')
-rw-r--r--Lib/packaging/pypi/base.py48
1 files changed, 0 insertions, 48 deletions
diff --git a/Lib/packaging/pypi/base.py b/Lib/packaging/pypi/base.py
deleted file mode 100644
index 305fca9..0000000
--- a/Lib/packaging/pypi/base.py
+++ /dev/null
@@ -1,48 +0,0 @@
-"""Base class for index crawlers."""
-
-from packaging.pypi.dist import ReleasesList
-
-
-class BaseClient:
- """Base class containing common methods for the index crawlers/clients"""
-
- def __init__(self, prefer_final, prefer_source):
- self._prefer_final = prefer_final
- self._prefer_source = prefer_source
- self._index = self
-
- def _get_prefer_final(self, prefer_final=None):
- """Return the prefer_final internal parameter or the specified one if
- provided"""
- if prefer_final:
- return prefer_final
- else:
- return self._prefer_final
-
- def _get_prefer_source(self, prefer_source=None):
- """Return the prefer_source internal parameter or the specified one if
- provided"""
- if prefer_source:
- return prefer_source
- else:
- return self._prefer_source
-
- def _get_project(self, project_name):
- """Return an project instance, create it if necessary"""
- return self._projects.setdefault(project_name.lower(),
- ReleasesList(project_name, index=self._index))
-
- def download_distribution(self, requirements, temp_path=None,
- prefer_source=None, prefer_final=None):
- """Download a distribution from the last release according to the
- requirements.
-
- If temp_path is provided, download to this path, otherwise, create a
- temporary location for the download and return it.
- """
- prefer_final = self._get_prefer_final(prefer_final)
- prefer_source = self._get_prefer_source(prefer_source)
- release = self.get_release(requirements, prefer_final)
- if release:
- dist = release.get_distribution(prefer_source=prefer_source)
- return dist.download(temp_path)