[Python-checkins] python/dist/src/Lib/distutils dist.py,1.60,1.61

akuchling@users.sourceforge.net akuchling@users.sourceforge.net
2003年1月03日 07:24:40 -0800


Update of /cvsroot/python/python/dist/src/Lib/distutils
In directory sc8-pr-cvs1:/tmp/cvs-serv23946
Modified Files:
	dist.py 
Log Message:
[Patch #658094] PEP 301 implementation
 Add 'classifiers' keyword to DistributionMetadata
Index: dist.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/distutils/dist.py,v
retrieving revision 1.60
retrieving revision 1.61
diff -C2 -d -r1.60 -r1.61
*** dist.py	19 Nov 2002 13:12:27 -0000	1.60
--- dist.py	3 Jan 2003 15:24:36 -0000	1.61
***************
*** 94,97 ****
--- 94,99 ----
 ('platforms', None,
 "print the list of platforms"),
+ ('classifiers', None,
+ "print the list of classifiers"),
 ('keywords', None,
 "print the list of keywords"),
***************
*** 635,638 ****
--- 637,642 ----
 if opt in ['keywords', 'platforms']:
 print string.join(value, ',')
+ elif opt == 'classifiers':
+ print string.join(value, '\n')
 else:
 print value
***************
*** 963,967 ****
 "license", "description", "long_description",
 "keywords", "platforms", "fullname", "contact",
! "contact_email", "licence")
 
 def __init__ (self):
--- 967,971 ----
 "license", "description", "long_description",
 "keywords", "platforms", "fullname", "contact",
! "contact_email", "licence", "classifiers")
 
 def __init__ (self):
***************
*** 978,981 ****
--- 982,986 ----
 self.keywords = None
 self.platforms = None
+ self.classifiers = None
 
 def write_pkg_info (self, base_dir):
***************
*** 1004,1007 ****
--- 1009,1015 ----
 pkg_info.write('Platform: %s\n' % platform )
 
+ for classifier in self.get_classifiers():
+ pkg_info.write('Classifier: %s\n' % classifier )
+ 
 pkg_info.close()
 
***************
*** 1059,1062 ****
--- 1067,1073 ----
 def get_platforms(self):
 return self.platforms or ["UNKNOWN"]
+ 
+ def get_classifiers(self):
+ return self.classifiers or []
 
 # class DistributionMetadata

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