Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions | Static Private Attributes
distutils.dist.DistributionMetadata Class Reference

List of all members.

Public Member Functions

def __init__
def write_pkg_info
def write_pkg_file
def get_name
def get_version
def get_fullname
def get_author
def get_author_email
def get_maintainer
def get_maintainer_email
def get_contact
def get_contact_email
def get_url
def get_license
def get_description
def get_long_description
def get_keywords
def get_platforms
def get_classifiers
def get_download_url
def get_requires
def set_requires
def get_provides
def set_provides
def get_obsoletes
def set_obsoletes

Public Attributes

 name
 version
 author
 author_email
 maintainer
 maintainer_email
 url
 license
 description
 long_description
 keywords
 platforms
 classifiers
 download_url
 provides
 requires
 obsoletes

Static Public Attributes

 get_licence = get_license

Private Member Functions

def _write_list

Static Private Attributes

tuple _METHOD_BASENAMES

Detailed Description

Dummy class to hold the distribution meta-data: name, version,
author, and so forth.

Definition at line 975 of file dist.py.


Constructor & Destructor Documentation

Definition at line 990 of file dist.py.

00990 
00991     def __init__ (self):
00992         self.name = None
00993         self.version = None
00994         self.author = None
00995         self.author_email = None
00996         self.maintainer = None
00997         self.maintainer_email = None
00998         self.url = None
00999         self.license = None
01000         self.description = None
01001         self.long_description = None
01002         self.keywords = None
01003         self.platforms = None
01004         self.classifiers = None
01005         self.download_url = None
01006         # PEP 314
01007         self.provides = None
01008         self.requires = None
01009         self.obsoletes = None

Here is the caller graph for this function:


Member Function Documentation

def distutils.dist.DistributionMetadata._write_list (   self,
  file,
  name,
  values 
) [private]

Definition at line 1052 of file dist.py.

01052 
01053     def _write_list(self, file, name, values):
01054         for value in values:
01055             file.write('%s: %s\n' % (name, value))

Here is the caller graph for this function:

Definition at line 1067 of file dist.py.

01067 
01068     def get_author(self):
01069         return self.author or "UNKNOWN"

Definition at line 1070 of file dist.py.

01070 
01071     def get_author_email(self):
01072         return self.author_email or "UNKNOWN"

Definition at line 1104 of file dist.py.

01104 
01105     def get_classifiers(self):
01106         return self.classifiers or []

Here is the caller graph for this function:

Definition at line 1079 of file dist.py.

01079 
01080     def get_contact(self):
01081         return self.maintainer or self.author or "UNKNOWN"

Here is the caller graph for this function:

Definition at line 1082 of file dist.py.

01082 
01083     def get_contact_email(self):
01084         return self.maintainer_email or self.author_email or "UNKNOWN"

Here is the caller graph for this function:

Definition at line 1092 of file dist.py.

01092 
01093     def get_description(self):
01094         return self.description or "UNKNOWN"

Here is the caller graph for this function:

Definition at line 1107 of file dist.py.

01107 
01108     def get_download_url(self):
01109         return self.download_url or "UNKNOWN"

Definition at line 1064 of file dist.py.

01064 
01065     def get_fullname(self):
01066         return "%s-%s" % (self.get_name(), self.get_version())

Here is the call graph for this function:

Definition at line 1098 of file dist.py.

01098 
01099     def get_keywords(self):
01100         return self.keywords or []

Here is the caller graph for this function:

Definition at line 1088 of file dist.py.

01088 
01089     def get_license(self):
        return self.license or "UNKNOWN"

Here is the caller graph for this function:

Definition at line 1095 of file dist.py.

01095 
01096     def get_long_description(self):
01097         return self.long_description or "UNKNOWN"

Here is the caller graph for this function:

Definition at line 1073 of file dist.py.

01073 
01074     def get_maintainer(self):
01075         return self.maintainer or "UNKNOWN"

Definition at line 1076 of file dist.py.

01076 
01077     def get_maintainer_email(self):
01078         return self.maintainer_email or "UNKNOWN"

Definition at line 1058 of file dist.py.

01058 
01059     def get_name(self):
01060         return self.name or "UNKNOWN"

Here is the caller graph for this function:

Definition at line 1130 of file dist.py.

01130 
01131     def get_obsoletes(self):
01132         return self.obsoletes or []

Here is the caller graph for this function:

Definition at line 1101 of file dist.py.

01101 
01102     def get_platforms(self):
01103         return self.platforms or ["UNKNOWN"]

Here is the caller graph for this function:

Definition at line 1120 of file dist.py.

01120 
01121     def get_provides(self):
01122         return self.provides or []

Here is the caller graph for this function:

Definition at line 1111 of file dist.py.

01111 
01112     def get_requires(self):
01113         return self.requires or []

Here is the caller graph for this function:

Definition at line 1085 of file dist.py.

01085 
01086     def get_url(self):
01087         return self.url or "UNKNOWN"

Here is the caller graph for this function:

Definition at line 1061 of file dist.py.

01061 
01062     def get_version(self):
01063         return self.version or "0.0.0"

Here is the caller graph for this function:

Definition at line 1133 of file dist.py.

01133 
01134     def set_obsoletes(self, value):
01135         import distutils.versionpredicate
01136         for v in value:
01137             distutils.versionpredicate.VersionPredicate(v)
01138         self.obsoletes = value

Definition at line 1123 of file dist.py.

01123 
01124     def set_provides(self, value):
01125         value = [v.strip() for v in value]
01126         for v in value:
01127             import distutils.versionpredicate
01128             distutils.versionpredicate.split_provision(v)
01129         self.provides = value

Here is the call graph for this function:

Definition at line 1114 of file dist.py.

01114 
01115     def set_requires(self, value):
01116         import distutils.versionpredicate
01117         for v in value:
01118             distutils.versionpredicate.VersionPredicate(v)
01119         self.requires = value

Write the PKG-INFO format data to a file object.

Definition at line 1019 of file dist.py.

01019 
01020     def write_pkg_file(self, file):
01021         """Write the PKG-INFO format data to a file object.
01022         """
01023         version = '1.0'
01024         if self.provides or self.requires or self.obsoletes:
01025             version = '1.1'
01026 
01027         file.write('Metadata-Version: %s\n' % version)
01028         file.write('Name: %s\n' % self.get_name() )
01029         file.write('Version: %s\n' % self.get_version() )
01030         file.write('Summary: %s\n' % self.get_description() )
01031         file.write('Home-page: %s\n' % self.get_url() )
01032         file.write('Author: %s\n' % self.get_contact() )
01033         file.write('Author-email: %s\n' % self.get_contact_email() )
01034         file.write('License: %s\n' % self.get_license() )
01035         if self.download_url:
01036             file.write('Download-URL: %s\n' % self.download_url)
01037 
01038         long_desc = rfc822_escape(self.get_long_description())
01039         file.write('Description: %s\n' % long_desc)
01040 
01041         keywords = ','.join(self.get_keywords())
01042         if keywords:
01043             file.write('Keywords: %s\n' % keywords )
01044 
01045         self._write_list(file, 'Platform', self.get_platforms())
01046         self._write_list(file, 'Classifier', self.get_classifiers())
01047 
01048         # PEP 314
01049         self._write_list(file, 'Requires', self.get_requires())
01050         self._write_list(file, 'Provides', self.get_provides())
01051         self._write_list(file, 'Obsoletes', self.get_obsoletes())

Here is the call graph for this function:

Here is the caller graph for this function:

Write the PKG-INFO file into the release tree.

Definition at line 1010 of file dist.py.

01010 
01011     def write_pkg_info(self, base_dir):
01012         """Write the PKG-INFO file into the release tree.
01013         """
01014         pkg_info = open(os.path.join(base_dir, 'PKG-INFO'), 'w')
01015         try:
01016             self.write_pkg_file(pkg_info)
01017         finally:
01018             pkg_info.close()

Here is the call graph for this function:


Member Data Documentation

Initial value:
("name", "version", "author", "author_email",
                         "maintainer", "maintainer_email", "url",
                         "license", "description", "long_description",
                         "keywords", "platforms", "fullname", "contact",
                         "contact_email", "license", "classifiers",
                         "download_url",
                         # PEP 314
                         "provides", "requires", "obsoletes",
                         )

Definition at line 980 of file dist.py.

Definition at line 993 of file dist.py.

Definition at line 994 of file dist.py.

Definition at line 1003 of file dist.py.

Definition at line 999 of file dist.py.

Definition at line 1004 of file dist.py.

Definition at line 1090 of file dist.py.

Definition at line 1001 of file dist.py.

Definition at line 998 of file dist.py.

Definition at line 1000 of file dist.py.

Definition at line 995 of file dist.py.

Definition at line 996 of file dist.py.

Definition at line 991 of file dist.py.

Definition at line 1008 of file dist.py.

Definition at line 1002 of file dist.py.

Definition at line 1006 of file dist.py.

Definition at line 1007 of file dist.py.

Definition at line 997 of file dist.py.

Definition at line 992 of file dist.py.


The documentation for this class was generated from the following file: