aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools
diff options
context:
space:
mode:
authorPJ Eby <distutils-sig@python.org>2005-08-07 01:03:36 +0000
committerPJ Eby <distutils-sig@python.org>2005-08-07 01:03:36 +0000
commit57f7bd7e62e6b0ab53bcb33f91abe3ca9917e782 (patch)
treea5f039a161f5ce6bc815bb59403400f27fe92a45 /setuptools
parent899e59ff5150705852f15f90fddbfedf7544bec1 (diff)
downloadexternal_python_setuptools-57f7bd7e62e6b0ab53bcb33f91abe3ca9917e782.tar.gz
external_python_setuptools-57f7bd7e62e6b0ab53bcb33f91abe3ca9917e782.tar.bz2
external_python_setuptools-57f7bd7e62e6b0ab53bcb33f91abe3ca9917e782.zip
Renamed AvailableDistributions -> Environment. Add sketch of pkg_resources
manual outline. --HG-- branch : setuptools extra : convert_revision : svn%3A6015fed2-1504-0410-9fe1-9d1591cc4771/sandbox/trunk/setuptools%4041184
Diffstat (limited to 'setuptools')
-rwxr-xr-xsetuptools/command/easy_install.py12
-rwxr-xr-xsetuptools/package_index.py4
-rw-r--r--setuptools/tests/test_resources.py4
3 files changed, 10 insertions, 10 deletions
diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py
index 8c1a3110..63260350 100755
--- a/setuptools/command/easy_install.py
+++ b/setuptools/command/easy_install.py
@@ -181,7 +181,7 @@ class easy_install(Command):
self.package_index = self.create_index(
self.index_url, search_path = self.shadow_path
)
- self.local_index = AvailableDistributions(self.shadow_path)
+ self.local_index = Environment(self.shadow_path)
if self.find_links is not None:
if isinstance(self.find_links, basestring):
@@ -805,7 +805,7 @@ See the setuptools documentation for the "develop" command for more info.
try:
args.append(dist_dir)
self.run_setup(setup_script, setup_base, args)
- all_eggs = AvailableDistributions([dist_dir])
+ all_eggs = Environment([dist_dir])
eggs = []
for key in all_eggs:
for dist in all_eggs[key]:
@@ -1064,14 +1064,14 @@ def parse_requirement_arg(spec):
-class PthDistributions(AvailableDistributions):
+class PthDistributions(Environment):
"""A .pth file with Distribution paths in it"""
dirty = False
def __init__(self, filename):
self.filename = filename; self._load()
- AvailableDistributions.__init__(
+ Environment.__init__(
self, list(yield_lines(self.paths)), None, None
)
@@ -1109,13 +1109,13 @@ class PthDistributions(AvailableDistributions):
"""Add `dist` to the distribution map"""
if dist.location not in self.paths:
self.paths.append(dist.location); self.dirty = True
- AvailableDistributions.add(self,dist)
+ Environment.add(self,dist)
def remove(self,dist):
"""Remove `dist` from the distribution map"""
while dist.location in self.paths:
self.paths.remove(dist.location); self.dirty = True
- AvailableDistributions.remove(self,dist)
+ Environment.remove(self,dist)
def main(argv, **kw):
diff --git a/setuptools/package_index.py b/setuptools/package_index.py
index d5013795..6ef185f0 100755
--- a/setuptools/package_index.py
+++ b/setuptools/package_index.py
@@ -121,11 +121,11 @@ def interpret_distro_name(location, basename, metadata,
-class PackageIndex(AvailableDistributions):
+class PackageIndex(Environment):
"""A distribution index that scans web pages for download URLs"""
def __init__(self,index_url="http://www.python.org/pypi",*args,**kw):
- AvailableDistributions.__init__(self,*args,**kw)
+ Environment.__init__(self,*args,**kw)
self.index_url = index_url + "/"[:not index_url.endswith('/')]
self.scanned_urls = {}
self.fetched_urls = {}
diff --git a/setuptools/tests/test_resources.py b/setuptools/tests/test_resources.py
index 865065c2..7ec9b980 100644
--- a/setuptools/tests/test_resources.py
+++ b/setuptools/tests/test_resources.py
@@ -23,7 +23,7 @@ class DistroTests(TestCase):
def testCollection(self):
# empty path should produce no distributions
- ad = AvailableDistributions([], python=None)
+ ad = Environment([], python=None)
self.assertEqual(list(ad), [])
self.assertEqual(len(ad),0)
self.assertEqual(ad.get('FooPkg'),None)
@@ -122,7 +122,7 @@ class DistroTests(TestCase):
def testResolve(self):
- ad = AvailableDistributions([]); ws = WorkingSet([])
+ ad = Environment([]); ws = WorkingSet([])
# Resolving no requirements -> nothing to install
self.assertEqual( list(ws.resolve([],ad)), [] )