diff options
author | Greg Ward <gward@python.net> | 2000-03-29 02:20:45 (GMT) |
---|---|---|
committer | Greg Ward <gward@python.net> | 2000-03-29 02:20:45 (GMT) |
commit | f00c34da1d0ba4641829adb264fcb20c663b872e (patch) | |
tree | eadec3fbfcbca9a31af32b1679beccb646c6f399 /Lib/distutils | |
parent | ab9d08ce654be8f555b2a8a08ae56c1e63ba2fec (diff) | |
download | cpython-f00c34da1d0ba4641829adb264fcb20c663b872e.zip cpython-f00c34da1d0ba4641829adb264fcb20c663b872e.tar.gz cpython-f00c34da1d0ba4641829adb264fcb20c663b872e.tar.bz2 |
Added the "distribution query" methods: 'has_pure_modules()',
'has_ext_modules()', 'has_c_libraries()', 'has_modules()', and 'is_pure()'.
Diffstat (limited to 'Lib/distutils')
-rw-r--r-- | Lib/distutils/core.py | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/Lib/distutils/core.py b/Lib/distutils/core.py index 5090f25..08a1d64 100644 --- a/Lib/distutils/core.py +++ b/Lib/distutils/core.py @@ -618,7 +618,27 @@ class Distribution: return tuple (values) -# end class Distribution + + # -- Distribution query methods ------------------------------------ + + def has_pure_modules (self): + return len (self.packages or self.py_modules or []) > 0 + + def has_ext_modules (self): + return self.ext_modules and len (self.ext_modules) > 0 + + def has_c_libraries (self): + return self.libraries and len (self.libraries) > 0 + + def has_modules (self): + return self.has_pure_modules() or self.has_ext_modules() + + def is_pure (self): + return (self.has_pure_modules() and + not self.has_ext_modules() and + not self.has_c_libraries()) + +# class Distribution class Command: @@ -992,4 +1012,4 @@ class Command: # make_file () -# end class Command +# class Command |