Commit f6611f2d authored by agronholm's avatar agronholm

Convert string template arguments in logger calls to logger arguments

--HG--
branch : distribute
extra : rebase_source : 1b7daa92fb9bd814a4028ec9d51774bfbeff41f3
parent e7932397
...@@ -63,7 +63,7 @@ def python_cmd(cmd): ...@@ -63,7 +63,7 @@ def python_cmd(cmd):
def _install(tarball): def _install(tarball):
# extracting the tarball # extracting the tarball
tmpdir = tempfile.mkdtemp() tmpdir = tempfile.mkdtemp()
log.warn('Extracting in %s' % tmpdir) log.warn('Extracting in %s', tmpdir)
old_wd = os.getcwd() old_wd = os.getcwd()
try: try:
os.chdir(tmpdir) os.chdir(tmpdir)
...@@ -74,7 +74,7 @@ def _install(tarball): ...@@ -74,7 +74,7 @@ def _install(tarball):
# going in the directory # going in the directory
subdir = os.path.join(tmpdir, os.listdir(tmpdir)[0]) subdir = os.path.join(tmpdir, os.listdir(tmpdir)[0])
os.chdir(subdir) os.chdir(subdir)
log.warn('Now working in %s' % subdir) log.warn('Now working in %s', subdir)
# installing # installing
log.warn('Installing Distribute') log.warn('Installing Distribute')
...@@ -86,7 +86,7 @@ def _install(tarball): ...@@ -86,7 +86,7 @@ def _install(tarball):
def _build_egg(tarball, to_dir=os.curdir): def _build_egg(tarball, to_dir=os.curdir):
# extracting the tarball # extracting the tarball
tmpdir = tempfile.mkdtemp() tmpdir = tempfile.mkdtemp()
log.warn('Extracting in %s' % tmpdir) log.warn('Extracting in %s', tmpdir)
old_wd = os.getcwd() old_wd = os.getcwd()
try: try:
os.chdir(tmpdir) os.chdir(tmpdir)
...@@ -97,10 +97,10 @@ def _build_egg(tarball, to_dir=os.curdir): ...@@ -97,10 +97,10 @@ def _build_egg(tarball, to_dir=os.curdir):
# going in the directory # going in the directory
subdir = os.path.join(tmpdir, os.listdir(tmpdir)[0]) subdir = os.path.join(tmpdir, os.listdir(tmpdir)[0])
os.chdir(subdir) os.chdir(subdir)
log.warn('Now working in %s' % subdir) log.warn('Now working in %s', subdir)
# building an egg # building an egg
log.warn('Building a Distribute egg in %s' % to_dir) log.warn('Building a Distribute egg in %s', to_dir)
python_cmd('setup.py -q bdist_egg --dist-dir %s' % to_dir) python_cmd('setup.py -q bdist_egg --dist-dir %s' % to_dir)
# returning the result # returning the result
...@@ -206,7 +206,7 @@ def _same_content(path, content): ...@@ -206,7 +206,7 @@ def _same_content(path, content):
def _rename_path(path): def _rename_path(path):
new_name = path + '.OLD.%s' % time.time() new_name = path + '.OLD.%s' % time.time()
log.warn('Renaming %s into %s' % (path, new_name)) log.warn('Renaming %s into %s', path, new_name)
try: try:
from setuptools.sandbox import DirectorySandbox from setuptools.sandbox import DirectorySandbox
def _violation(*args): def _violation(*args):
...@@ -221,7 +221,7 @@ def _rename_path(path): ...@@ -221,7 +221,7 @@ def _rename_path(path):
def _remove_flat_installation(placeholder): def _remove_flat_installation(placeholder):
if not os.path.isdir(placeholder): if not os.path.isdir(placeholder):
log.warn('Unkown installation at %s' % placeholder) log.warn('Unkown installation at %s', placeholder)
return False return False
found = False found = False
for file in os.listdir(placeholder): for file in os.listdir(placeholder):
...@@ -239,7 +239,7 @@ def _remove_flat_installation(placeholder): ...@@ -239,7 +239,7 @@ def _remove_flat_installation(placeholder):
patched = _patch_file(pkg_info, SETUPTOOLS_PKG_INFO) patched = _patch_file(pkg_info, SETUPTOOLS_PKG_INFO)
if not patched: if not patched:
log.warn('%s already patched.' % pkg_info) log.warn('%s already patched.', pkg_info)
return False return False
# now let's move the files out of the way # now let's move the files out of the way
for element in ('setuptools', 'pkg_resources.py', 'site.py'): for element in ('setuptools', 'pkg_resources.py', 'site.py'):
...@@ -248,7 +248,7 @@ def _remove_flat_installation(placeholder): ...@@ -248,7 +248,7 @@ def _remove_flat_installation(placeholder):
_rename_path(element) _rename_path(element)
else: else:
log.warn('Could not find the %s element of the ' log.warn('Could not find the %s element of the '
'Setuptools distribution' % element) 'Setuptools distribution', element)
return True return True
...@@ -262,16 +262,16 @@ def after_install(dist): ...@@ -262,16 +262,16 @@ def after_install(dist):
setuptools_file = 'setuptools-0.6c9-py%s.egg-info' % pyver setuptools_file = 'setuptools-0.6c9-py%s.egg-info' % pyver
pkg_info = os.path.join(placeholder, setuptools_file) pkg_info = os.path.join(placeholder, setuptools_file)
if os.path.exists(pkg_info): if os.path.exists(pkg_info):
log.warn('%s already exists' % pkg_info) log.warn('%s already exists', pkg_info)
return return
log.warn('Creating %s' % pkg_info) log.warn('Creating %s', pkg_info)
f = open(pkg_info, 'w') f = open(pkg_info, 'w')
try: try:
f.write(SETUPTOOLS_PKG_INFO) f.write(SETUPTOOLS_PKG_INFO)
finally: finally:
f.close() f.close()
pth_file = os.path.join(placeholder, 'setuptools.pth') pth_file = os.path.join(placeholder, 'setuptools.pth')
log.warn('Creating %s' % pth_file) log.warn('Creating %s', pth_file)
f = open(pth_file, 'w') f = open(pth_file, 'w')
try: try:
f.write(os.path.join(os.curdir, setuptools_file)) f.write(os.path.join(os.curdir, setuptools_file))
...@@ -284,7 +284,7 @@ def _patch_egg_dir(path): ...@@ -284,7 +284,7 @@ def _patch_egg_dir(path):
pkg_info = os.path.join(path, 'EGG-INFO', 'PKG-INFO') pkg_info = os.path.join(path, 'EGG-INFO', 'PKG-INFO')
if os.path.exists(pkg_info): if os.path.exists(pkg_info):
if _same_content(pkg_info, SETUPTOOLS_PKG_INFO): if _same_content(pkg_info, SETUPTOOLS_PKG_INFO):
log.warn('%s already patched.' % pkg_info) log.warn('%s already patched.', pkg_info)
return False return False
_rename_path(path) _rename_path(path)
os.mkdir(path) os.mkdir(path)
...@@ -336,7 +336,7 @@ def fake_setuptools(): ...@@ -336,7 +336,7 @@ def fake_setuptools():
return return
# detecting if it was already faked # detecting if it was already faked
setuptools_location = setuptools_dist.location setuptools_location = setuptools_dist.location
log.warn('Setuptools installation detected at %s' % setuptools_location) log.warn('Setuptools installation detected at %s', setuptools_location)
# if --root or --preix was provided, and if # if --root or --preix was provided, and if
# setuptools is not located in them, we don't patch it # setuptools is not located in them, we don't patch it
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment