mirror of
https://github.com/python/cpython.git
synced 2025-11-17 01:25:57 +00:00
Fix how we generate the meta-data query methods to include 'get_fullname()'
and the other "composite meta-data" methods.
This commit is contained in:
parent
0ae7f76b40
commit
4982f98bc9
1 changed files with 5 additions and 3 deletions
|
|
@ -123,9 +123,11 @@ class Distribution:
|
||||||
# worth it. Also delegate 'get_XXX()' methods to the 'metadata'
|
# worth it. Also delegate 'get_XXX()' methods to the 'metadata'
|
||||||
# object in a sneaky and underhanded (but efficient!) way.
|
# object in a sneaky and underhanded (but efficient!) way.
|
||||||
self.metadata = DistributionMetadata ()
|
self.metadata = DistributionMetadata ()
|
||||||
for attr in dir(self.metadata):
|
method_basenames = dir(self.metadata) + \
|
||||||
meth_name = "get_" + attr
|
['fullname', 'contact', 'contact_email']
|
||||||
setattr(self, meth_name, getattr(self.metadata, meth_name))
|
for basename in method_basenames:
|
||||||
|
method_name = "get_" + basename
|
||||||
|
setattr(self, method_name, getattr(self.metadata, method_name))
|
||||||
|
|
||||||
# 'cmdclass' maps command names to class objects, so we
|
# 'cmdclass' maps command names to class objects, so we
|
||||||
# can 1) quickly figure out which class to instantiate when
|
# can 1) quickly figure out which class to instantiate when
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue