summaryrefslogtreecommitdiff
path: root/distutils2/command
diff options
context:
space:
mode:
Diffstat (limited to 'distutils2/command')
-rw-r--r--distutils2/command/bdist_dumb.py13
-rw-r--r--distutils2/command/bdist_wininst.py2
-rw-r--r--distutils2/command/clean.py4
-rw-r--r--distutils2/command/cmd.py4
-rw-r--r--distutils2/command/config.py2
-rw-r--r--distutils2/command/install_dist.py2
-rw-r--r--distutils2/command/register.py10
-rw-r--r--distutils2/command/sdist.py12
8 files changed, 23 insertions, 26 deletions
diff --git a/distutils2/command/bdist_dumb.py b/distutils2/command/bdist_dumb.py
index 8aed45c..419b80c 100644
--- a/distutils2/command/bdist_dumb.py
+++ b/distutils2/command/bdist_dumb.py
@@ -87,7 +87,7 @@ class bdist_dumb (Command):
install.skip_build = self.skip_build
install.warn_dir = 0
- logger.info("installing to %s" % self.bdist_dir)
+ logger.info("installing to %s", self.bdist_dir)
self.run_command('install_dist')
# And make an archive relative to the root of the
@@ -106,11 +106,10 @@ class bdist_dumb (Command):
else:
if (self.distribution.has_ext_modules() and
(install.install_base != install.install_platbase)):
- raise DistutilsPlatformError, \
- ("can't make a dumb built distribution where "
- "base and platbase are different (%s, %s)"
- % (repr(install.install_base),
- repr(install.install_platbase)))
+ raise DistutilsPlatformError(
+ "can't make a dumb built distribution where base and "
+ "platbase are different (%r, %r)" %
+ (install.install_base, install.install_platbase))
else:
archive_root = os.path.join(
self.bdist_dir,
@@ -129,7 +128,7 @@ class bdist_dumb (Command):
if not self.keep_temp:
if self.dry_run:
- logger.info('Removing %s' % self.bdist_dir)
+ logger.info('Removing %s', self.bdist_dir)
else:
rmtree(self.bdist_dir)
diff --git a/distutils2/command/bdist_wininst.py b/distutils2/command/bdist_wininst.py
index 40f151f..ecea86b 100644
--- a/distutils2/command/bdist_wininst.py
+++ b/distutils2/command/bdist_wininst.py
@@ -192,7 +192,7 @@ class bdist_wininst (Command):
if not self.keep_temp:
if self.dry_run:
- logger.info('Removing %s' % self.bdist_dir)
+ logger.info('Removing %s', self.bdist_dir)
else:
rmtree(self.bdist_dir)
diff --git a/distutils2/command/clean.py b/distutils2/command/clean.py
index 295cfac..97ea367 100644
--- a/distutils2/command/clean.py
+++ b/distutils2/command/clean.py
@@ -48,7 +48,7 @@ class clean(Command):
# gone)
if os.path.exists(self.build_temp):
if self.dry_run:
- logger.info('Removing %s' % self.build_temp)
+ logger.info('Removing %s', self.build_temp)
else:
rmtree(self.build_temp)
else:
@@ -62,7 +62,7 @@ class clean(Command):
self.build_scripts):
if os.path.exists(directory):
if self.dry_run:
- logger.info('Removing %s' % directory)
+ logger.info('Removing %s', directory)
else:
rmtree(directory)
else:
diff --git a/distutils2/command/cmd.py b/distutils2/command/cmd.py
index 0e4d99e..e91d924 100644
--- a/distutils2/command/cmd.py
+++ b/distutils2/command/cmd.py
@@ -182,6 +182,7 @@ class Command(object):
raise RuntimeError(
"abstract method -- subclass %s must override" % self.__class__)
+ # TODO remove this method, just use logging
def announce(self, msg, level=logging.INFO):
"""If the current verbosity level is of greater than or equal to
'level' print 'msg' to stdout.
@@ -363,8 +364,9 @@ class Command(object):
# -- External world manipulation -----------------------------------
+ # TODO remove this method, just use logging
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)
diff --git a/distutils2/command/config.py b/distutils2/command/config.py
index 0f4ae9f..411ad26 100644
--- a/distutils2/command/config.py
+++ b/distutils2/command/config.py
@@ -345,7 +345,7 @@ def dump_file(filename, head=None):
If head is not None, will be dumped before the file content.
"""
if head is None:
- logger.info('%s' % filename)
+ logger.info(filename)
else:
logger.info(head)
file = open(filename)
diff --git a/distutils2/command/install_dist.py b/distutils2/command/install_dist.py
index 146c905..247a10e 100644
--- a/distutils2/command/install_dist.py
+++ b/distutils2/command/install_dist.py
@@ -418,7 +418,7 @@ class install_dist(Command):
else:
opt_name = opt_name.replace('-', '_')
val = getattr(self, opt_name)
- logger.debug(" %s: %s" % (opt_name, val))
+ logger.debug(" %s: %s", opt_name, val)
def select_scheme(self, name):
"""Set the install directories by applying the install schemes."""
diff --git a/distutils2/command/register.py b/distutils2/command/register.py
index 74f708c..3d5bc23 100644
--- a/distutils2/command/register.py
+++ b/distutils2/command/register.py
@@ -92,7 +92,7 @@ class register(Command):
'''
# send the info to the server and report the result
code, result = self.post_to_server(self.build_post_data('verify'))
- logger.info('Server response (%s): %s' % (code, result))
+ logger.info('Server response (%s): %s', code, result)
def send_metadata(self):
@@ -206,18 +206,18 @@ Your selection [default 1]: ''', logging.INFO)
data['email'] = raw_input(' EMail: ')
code, result = self.post_to_server(data)
if code != 200:
- logger.info('Server response (%s): %s' % (code, result))
+ logger.info('Server response (%s): %s', code, result)
else:
logger.info('You will receive an email shortly.')
- logger.info(('Follow the instructions in it to '
- 'complete registration.'))
+ logger.info('Follow the instructions in it to '
+ 'complete registration.')
elif choice == '3':
data = {':action': 'password_reset'}
data['email'] = ''
while not data['email']:
data['email'] = raw_input('Your email address: ')
code, result = self.post_to_server(data)
- logger.info('Server response (%s): %s' % (code, result))
+ logger.info('Server response (%s): %s', (code, result))
def build_post_data(self, action):
# figure the data to send - the metadata plus some additional
diff --git a/distutils2/command/sdist.py b/distutils2/command/sdist.py
index 5aff9bd..3c78f81 100644
--- a/distutils2/command/sdist.py
+++ b/distutils2/command/sdist.py
@@ -2,10 +2,7 @@
Implements the Distutils 'sdist' command (create a source distribution)."""
import os
-import string
import sys
-from glob import glob
-from warnings import warn
from shutil import rmtree
import re
from StringIO import StringIO
@@ -18,11 +15,10 @@ except ImportError:
from distutils2.command import get_command_names
from distutils2.command.cmd import Command
from distutils2.errors import (DistutilsPlatformError, DistutilsOptionError,
- DistutilsTemplateError, DistutilsModuleError,
- DistutilsFileError)
+ DistutilsModuleError, DistutilsFileError)
from distutils2.manifest import Manifest
from distutils2 import logger
-from distutils2.util import convert_path, resolve_name
+from distutils2.util import resolve_name
def show_formats():
"""Print all possible values for the 'formats' option (used by
@@ -300,7 +296,7 @@ class sdist(Command):
for file in files:
if not os.path.isfile(file):
- logger.warn("'%s' not a regular file -- skipping" % file)
+ logger.warn("'%s' not a regular file -- skipping", file)
else:
dest = os.path.join(base_dir, file)
self.copy_file(file, dest, link=link)
@@ -336,7 +332,7 @@ class sdist(Command):
if not self.keep_temp:
if self.dry_run:
- logger.info('Removing %s' % base_dir)
+ logger.info('Removing %s', base_dir)
else:
rmtree(base_dir)