@@ -122,9 +122,7 @@ def __init__ (self, attrs=None):
122122 # worth it. Also delegate 'get_XXX()' methods to the 'metadata'
123123 # object in a sneaky and underhanded (but efficient!) way.
124124 self .metadata = DistributionMetadata ()
125- method_basenames = dir (self .metadata ) + \
126- ['fullname' , 'contact' , 'contact_email' ]
127- for basename in method_basenames :
125+ for basename in self .metadata ._METHOD_BASENAMES :
128126 method_name = "get_" + basename
129127 setattr (self , method_name , getattr (self .metadata , method_name ))
130128
@@ -962,6 +960,12 @@ class DistributionMetadata:
962960 author, and so forth.
963961 """
964962
963+ _METHOD_BASENAMES = ("name" , "version" , "author" , "author_email" ,
964+ "maintainer" , "maintainer_email" , "url" ,
965+ "license" , "description" , "long_description" ,
966+ "keywords" , "platforms" , "fullname" , "contact" ,
967+ "contact_email" , "licence" )
968+
965969 def __init__ (self ):
966970 self .name = None
967971 self .version = None
0 commit comments