Only print debugging output if DEBUG true (and deleted some of the more

extraneous debug prints).
This commit is contained in:
Greg Ward 2000-06-02 01:59:33 +00:00
parent f7a5507485
commit 2bd3f4250d
1 changed files with 7 additions and 6 deletions

View File

@ -294,15 +294,16 @@ class Distribution:
def parse_config_files (self, filenames=None): def parse_config_files (self, filenames=None):
from ConfigParser import ConfigParser from ConfigParser import ConfigParser
from distutils.core import DEBUG
if filenames is None: if filenames is None:
filenames = self.find_config_files() filenames = self.find_config_files()
print "Distribution.parse_config_files():" if DEBUG: print "Distribution.parse_config_files():"
parser = ConfigParser() parser = ConfigParser()
for filename in filenames: for filename in filenames:
print " reading", filename if DEBUG: print " reading", filename
parser.read(filename) parser.read(filename)
for section in parser.sections(): for section in parser.sections():
options = parser.options(section) options = parser.options(section)
@ -370,7 +371,6 @@ class Distribution:
# latter, we omit the display-only options and show help for # latter, we omit the display-only options and show help for
# each command listed on the command line. # each command listed on the command line.
if self.help: if self.help:
print "showing 'global' help; commands=", self.commands
self._show_help(parser, self._show_help(parser,
display_options=len(self.commands) == 0, display_options=len(self.commands) == 0,
commands=self.commands) commands=self.commands)
@ -440,7 +440,6 @@ class Distribution:
parser.set_negative_aliases (negative_opt) parser.set_negative_aliases (negative_opt)
(args, opts) = parser.getopt (args[1:]) (args, opts) = parser.getopt (args[1:])
if hasattr(opts, 'help') and opts.help: if hasattr(opts, 'help') and opts.help:
print "showing help for command", cmd_class
self._show_help(parser, display_options=0, commands=[cmd_class]) self._show_help(parser, display_options=0, commands=[cmd_class])
return return
@ -643,8 +642,10 @@ class Distribution:
object for 'command' is in the cache, then we either create and object for 'command' is in the cache, then we either create and
return it (if 'create' is true) or return None. return it (if 'create' is true) or return None.
""" """
from distutils.core import DEBUG
cmd_obj = self.command_obj.get(command) cmd_obj = self.command_obj.get(command)
if not cmd_obj and create: if not cmd_obj and create:
if DEBUG:
print "Distribution.get_command_obj(): " \ print "Distribution.get_command_obj(): " \
"creating '%s' command object" % command "creating '%s' command object" % command