[Python-checkins] distutils2: add docstring to all public api of DistributionMetadata

tarek.ziade python-checkins at python.org
Sat Jan 29 12:59:10 CET 2011


tarek.ziade pushed c3cf81fc64db to distutils2:
http://hg.python.org/distutils2/rev/c3cf81fc64db
changeset: 903:c3cf81fc64db
user: Gael Pasgrimaud <gael at gawel.org>
date: Fri Jan 28 18:39:05 2011 +0100
summary:
 add docstring to all public api of DistributionMetadata
files:
 distutils2/metadata.py
diff --git a/distutils2/metadata.py b/distutils2/metadata.py
--- a/distutils2/metadata.py
+++ b/distutils2/metadata.py
@@ -300,13 +300,16 @@
 # Public API
 #
 def get_fullname(self):
+ """Return the distribution name with version"""
 return '%s-%s' % (self['Name'], self['Version'])
 
 def is_metadata_field(self, name):
+ """return True if name is a valid metadata key"""
 name = self._convert_name(name)
 return name in _ALL_FIELDS
 
 def read(self, filepath):
+ """Read the metadata values from a file path."""
 self.read_file(open(filepath))
 
 def read_file(self, fileob):
@@ -501,12 +504,15 @@
 return missing, warnings
 
 def keys(self):
+ """Dict like api"""
 return _version2fieldlist(self.version)
 
 def values(self):
+ """Dict like api"""
 return [self[key] for key in self.keys()]
 
 def items(self):
+ """Dict like api"""
 return [(key, self[key]) for key in self.keys()]
 
 
--
Repository URL: http://hg.python.org/distutils2


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /