summaryrefslogtreecommitdiff
path: root/distutils2/command/cmd.py
diff options
context:
space:
mode:
authorArc Riley <arcriley@gmail.com>2011-03-13 00:12:23 -0500
committerArc Riley <arcriley@gmail.com>2011-03-13 00:12:23 -0500
commitefa667603bc41168dc547563fffef464b728adfa (patch)
tree6b3f76ba3d107c984335253b3d42d9ab65cb7748 /distutils2/command/cmd.py
parentf3f78c2aca495aed87bc416e5f20134b9d0fc351 (diff)
parente2d2d3d18380338920819d2bd0524f6629b1874b (diff)
downloaddisutils2-efa667603bc41168dc547563fffef464b728adfa.tar.gz
Branch merge to trunk
Diffstat (limited to 'distutils2/command/cmd.py')
-rw-r--r--distutils2/command/cmd.py16
1 files changed, 7 insertions, 9 deletions
diff --git a/distutils2/command/cmd.py b/distutils2/command/cmd.py
index e63c46b..9cfc5d9 100644
--- a/distutils2/command/cmd.py
+++ b/distutils2/command/cmd.py
@@ -10,14 +10,7 @@ import logging
from distutils2.errors import DistutilsOptionError
from distutils2 import util
from distutils2 import logger
-
-# XXX see if we want to backport this
-from distutils2._backport.shutil import copytree, copyfile, move
-
-try:
- from shutil import make_archive
-except ImportError:
- from distutils2._backport.shutil import make_archive
+from distutils2._backport.shutil import copytree, copyfile, move, make_archive
class Command(object):
@@ -165,7 +158,10 @@ class Command(object):
header = "command options for '%s':" % self.get_command_name()
self.announce(indent + header, level=logging.INFO)
indent = indent + " "
+ negative_opt = getattr(self, 'negative_opt', ())
for (option, _, _) in self.user_options:
+ if option in negative_opt:
+ continue
option = option.replace('-', '_')
if option[-1] == "=":
option = option[:-1]
@@ -186,6 +182,7 @@ class Command(object):
raise RuntimeError(
"abstract method -- subclass %s must override" % self.__class__)
+ # TODO remove this method, just use logging.info
def announce(self, msg, level=logging.INFO):
"""If the current verbosity level is of greater than or equal to
'level' print 'msg' to stdout.
@@ -367,8 +364,9 @@ class Command(object):
# -- External world manipulation -----------------------------------
+ # TODO remove this method, just use logging.warn
def warn(self, msg):
- logger.warning("warning: %s: %s\n" % (self.get_command_name(), msg))
+ logger.warning("warning: %s: %s\n", self.get_command_name(), msg)
def execute(self, func, args, msg=None, level=1):
util.execute(func, args, msg, dry_run=self.dry_run)