summaryrefslogtreecommitdiffstats
path: root/Lib/distutils/dist.py
diff options
context:
space:
mode:
authorAndrew M. Kuchling <amk@amk.ca>2003-02-19 14:16:01 (GMT)
committerAndrew M. Kuchling <amk@amk.ca>2003-02-19 14:16:01 (GMT)
commit188d85f475ff611ca09c1355610185f68e7236d3 (patch)
tree047bcd96e934e1c509d008951dbb289e76911b46 /Lib/distutils/dist.py
parent23c98c5f47f976edd37eec5efe09fd3847e464cf (diff)
downloadcpython-188d85f475ff611ca09c1355610185f68e7236d3.zip
cpython-188d85f475ff611ca09c1355610185f68e7236d3.tar.gz
cpython-188d85f475ff611ca09c1355610185f68e7236d3.tar.bz2
[Patch #683939] Add download_url field to metadata
Diffstat (limited to 'Lib/distutils/dist.py')
-rw-r--r--Lib/distutils/dist.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/Lib/distutils/dist.py b/Lib/distutils/dist.py
index f15c945..08e2a4f 100644
--- a/Lib/distutils/dist.py
+++ b/Lib/distutils/dist.py
@@ -966,7 +966,8 @@ class DistributionMetadata:
"maintainer", "maintainer_email", "url",
"license", "description", "long_description",
"keywords", "platforms", "fullname", "contact",
- "contact_email", "licence", "classifiers")
+ "contact_email", "licence", "classifiers",
+ "download_url")
def __init__ (self):
self.name = None
@@ -982,6 +983,7 @@ class DistributionMetadata:
self.keywords = None
self.platforms = None
self.classifiers = None
+ self.download_url = None
def write_pkg_info (self, base_dir):
"""Write the PKG-INFO file into the release tree.
@@ -997,6 +999,8 @@ class DistributionMetadata:
pkg_info.write('Author: %s\n' % self.get_contact() )
pkg_info.write('Author-email: %s\n' % self.get_contact_email() )
pkg_info.write('License: %s\n' % self.get_license() )
+ if self.download_url:
+ pkg_info.write('Download-URL: %s\n' % self.download_url)
long_desc = rfc822_escape( self.get_long_description() )
pkg_info.write('Description: %s\n' % long_desc)
@@ -1070,6 +1074,9 @@ class DistributionMetadata:
def get_classifiers(self):
return self.classifiers or []
+ def get_download_url(self):
+ return self.download_url or "UNKNOWN"
+
# class DistributionMetadata