[Python-checkins] distutils2: Fix a typo before it gets out

tarek.ziade python-checkins at python.org
Thu Jun 24 10:05:21 CEST 2010


tarek.ziade pushed 50a2d9f35e22 to distutils2:

http://hg.python.org/distutils2/rev/50a2d9f35e22
changeset:   223:50a2d9f35e22
user:        ?ric Araujo <merwok at netwok.org>
date:        Fri Jun 11 23:22:41 2010 +0200
summary:     Fix a typo before it gets out
files:       docs/source/metadata.rst, src/distutils2/metadata.py, src/distutils2/tests/test_metadata.py

diff --git a/docs/source/metadata.rst b/docs/source/metadata.rst
--- a/docs/source/metadata.rst
+++ b/docs/source/metadata.rst
@@ -32,14 +32,14 @@
     ["pywin32; sys.platform == 'win32'", "Sphinx"]
 
 The fields that supports environment markers can be automatically ignored if
-the object is instantiated using the ``platform_dependant`` option.
+the object is instantiated using the ``platform_dependent`` option.
 :class:`DistributionMetadata` will interpret in the case the markers and will
 automatically remove the fields that are not compliant with the running
 environment. Here's an example under Mac OS X. The win32 dependency
 we saw earlier is ignored::
 
     >>> from distutils2.metadata import DistributionMetadata
-    >>> metadata = DistributionMetadata('PKG-INFO', platform_dependant=True)
+    >>> metadata = DistributionMetadata('PKG-INFO', platform_dependent=True)
     >>> metadata['Requires-Dist']
     ['bar']
 
@@ -53,7 +53,7 @@
 
     >>> from distutils2.metadata import DistributionMetadata
     >>> context = {'sys.platform': 'win32'}
-    >>> metadata = DistributionMetadata('PKG-INFO', platform_dependant=True,
+    >>> metadata = DistributionMetadata('PKG-INFO', platform_dependent=True,
     ...                                 execution_context=context)
     ...
     >>> metadata['Requires-Dist'] = ["pywin32; sys.platform == 'win32'",
diff --git a/src/distutils2/metadata.py b/src/distutils2/metadata.py
--- a/src/distutils2/metadata.py
+++ b/src/distutils2/metadata.py
@@ -184,12 +184,12 @@
 class DistributionMetadata(object):
     """Distribution meta-data class (1.0 or 1.2).
     """
-    def __init__(self, path=None, platform_dependant=False,
+    def __init__(self, path=None, platform_dependent=False,
                  execution_context=None):
         self._fields = {}
         self.version = None
         self.docutils_support = _HAS_DOCUTILS
-        self.platform_dependant = platform_dependant
+        self.platform_dependent = platform_dependent
         if path is not None:
             self.read(path)
         self.execution_context = execution_context
@@ -260,7 +260,7 @@
         return reporter.messages
 
     def _platform(self, value):
-        if not self.platform_dependant or ';' not in value:
+        if not self.platform_dependent or ';' not in value:
             return True, value
         value, marker = value.split(';')
         return _interpret(marker, self.execution_context), value
diff --git a/src/distutils2/tests/test_metadata.py b/src/distutils2/tests/test_metadata.py
--- a/src/distutils2/tests/test_metadata.py
+++ b/src/distutils2/tests/test_metadata.py
@@ -73,13 +73,13 @@
         PKG_INFO = os.path.join(os.path.dirname(__file__), 'PKG-INFO')
         content = open(PKG_INFO).read()
         content = content % sys.platform
-        metadata = DistributionMetadata(platform_dependant=True)
+        metadata = DistributionMetadata(platform_dependent=True)
         metadata.read_file(StringIO(content))
         self.assertEquals(metadata['Requires-Dist'], ['bar'])
 
         # test with context
         context = {'sys.platform': 'okook'}
-        metadata = DistributionMetadata(platform_dependant=True,
+        metadata = DistributionMetadata(platform_dependent=True,
                                         execution_context=context)
         metadata.read_file(StringIO(content))
         self.assertEquals(metadata['Requires-Dist'], ['foo'])

--
Repository URL: http://hg.python.org/distutils2


More information about the Python-checkins mailing list