]> granicus.if.org Git - python/commitdiff
[Patch #683939] Add download_url field to metadata
authorAndrew M. Kuchling <amk@amk.ca>
Wed, 19 Feb 2003 14:16:01 +0000 (14:16 +0000)
committerAndrew M. Kuchling <amk@amk.ca>
Wed, 19 Feb 2003 14:16:01 +0000 (14:16 +0000)
Lib/distutils/core.py
Lib/distutils/dist.py

index 29fbc5cdf95c6676c22aba4e4f99f596a281a7f7..a463272c2f858e3ce7d7baf26bf2a3ceac040d4f 100644 (file)
@@ -47,7 +47,7 @@ setup_keywords = ('distclass', 'script_name', 'script_args', 'options',
                   'name', 'version', 'author', 'author_email',
                   'maintainer', 'maintainer_email', 'url', 'license',
                   'description', 'long_description', 'keywords',
-                  'platforms', 'classifiers')
+                  'platforms', 'classifiers', 'download_url')
 
 # Legal keyword arguments for the Extension constructor
 extension_keywords = ('name', 'sources', 'include_dirs',
index f15c945c74468b943771ac99756c0bfdc8a4c4cf..08e2a4f7d877454903ff7892ed4058611a39e4bc 100644 (file)
@@ -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