aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools
diff options
context:
space:
mode:
authorPJ Eby <distutils-sig@python.org>2005-07-17 19:01:15 +0000
committerPJ Eby <distutils-sig@python.org>2005-07-17 19:01:15 +0000
commit63d507adccf8207a40e2b22a8c11f79efb83f56a (patch)
tree079ea1f80004c18837a93f3bdc66b039d8d5127a /setuptools
parent30f1c5ad93e21ec007d371313e2a27e4d0efb661 (diff)
downloadexternal_python_setuptools-63d507adccf8207a40e2b22a8c11f79efb83f56a.tar.gz
external_python_setuptools-63d507adccf8207a40e2b22a8c11f79efb83f56a.tar.bz2
external_python_setuptools-63d507adccf8207a40e2b22a8c11f79efb83f56a.zip
``Distribution`` objects now implement the ``IResourceProvider`` and
``IMetadataProvider`` interfaces, so you don't need to reference the (no longer available) ``metadata`` attribute to get at these interfaces. --HG-- branch : setuptools extra : convert_revision : svn%3A6015fed2-1504-0410-9fe1-9d1591cc4771/sandbox/trunk/setuptools%4041133
Diffstat (limited to 'setuptools')
-rwxr-xr-xsetuptools/command/easy_install.py12
-rw-r--r--setuptools/tests/test_resources.py2
2 files changed, 7 insertions, 7 deletions
diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py
index 6d61c951..b096a48e 100755
--- a/setuptools/command/easy_install.py
+++ b/setuptools/command/easy_install.py
@@ -368,22 +368,21 @@ class easy_install(Command):
)
def install_egg_scripts(self, dist):
- metadata = dist.metadata
- if self.exclude_scripts or not metadata.metadata_isdir('scripts'):
+ if self.exclude_scripts or not dist.metadata_isdir('scripts'):
return
- for script_name in metadata.metadata_listdir('scripts'):
+ for script_name in dist.metadata_listdir('scripts'):
self.install_script(
dist, script_name,
- metadata.get_metadata('scripts/'+script_name).replace('\r','\n')
+ dist.get_metadata('scripts/'+script_name).replace('\r','\n')
)
def should_unzip(self, dist):
if self.zip_ok is not None:
return not self.zip_ok
- if dist.metadata.has_metadata('not-zip-safe'):
+ if dist.has_metadata('not-zip-safe'):
return True
- if not dist.metadata.has_metadata('zip-safe'):
+ if not dist.has_metadata('zip-safe'):
return True
return False
@@ -408,6 +407,7 @@ class easy_install(Command):
+
def install_script(self, dist, script_name, script_text, dev_path=None):
log.info("Installing %s script to %s", script_name,self.script_dir)
target = os.path.join(self.script_dir, script_name)
diff --git a/setuptools/tests/test_resources.py b/setuptools/tests/test_resources.py
index 10786144..0a4cb183 100644
--- a/setuptools/tests/test_resources.py
+++ b/setuptools/tests/test_resources.py
@@ -3,7 +3,7 @@ from pkg_resources import *
import pkg_resources, sys
from sets import ImmutableSet
-class Metadata:
+class Metadata(EmptyProvider):
"""Mock object to return metadata as if from an on-disk distribution"""
def __init__(self,*pairs):