mirror of
https://github.com/python/cpython.git
synced 2025-10-30 13:11:29 +00:00
Added 'dump_options()' for debugging output.
This commit is contained in:
parent
c32d9a6952
commit
adda156a13
1 changed files with 15 additions and 0 deletions
|
|
@ -135,6 +135,21 @@ def finalize_options (self):
|
||||||
raise RuntimeError, \
|
raise RuntimeError, \
|
||||||
"abstract method -- subclass %s must override" % self.__class__
|
"abstract method -- subclass %s must override" % self.__class__
|
||||||
|
|
||||||
|
|
||||||
|
def dump_options (self, header=None, indent=""):
|
||||||
|
from distutils.fancy_getopt import longopt_xlate
|
||||||
|
if header is None:
|
||||||
|
header = "command options for '%s':" % self.get_command_name()
|
||||||
|
print indent + header
|
||||||
|
indent = indent + " "
|
||||||
|
for (option, _, _) in self.user_options:
|
||||||
|
option = string.translate(option, longopt_xlate)
|
||||||
|
if option[-1] == "=":
|
||||||
|
option = option[:-1]
|
||||||
|
value = getattr(self, option)
|
||||||
|
print indent + "%s = %s" % (option, value)
|
||||||
|
|
||||||
|
|
||||||
def run (self):
|
def run (self):
|
||||||
"""A command's raison d'etre: carry out the action it exists
|
"""A command's raison d'etre: carry out the action it exists
|
||||||
to perform, controlled by the options initialized in
|
to perform, controlled by the options initialized in
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue