use {0} instead of {} in format

This commit is contained in:
Radovan Bast
2016-04-14 12:12:41 +02:00
parent aebb3f7e60
commit 8319d41ba7
3 changed files with 36 additions and 36 deletions

View File

@ -23,7 +23,7 @@ def check_cmake_exists(cmake_command):
"""
from subprocess import Popen, PIPE
p = Popen('{} --version'.format(cmake_command),
p = Popen('{0} --version'.format(cmake_command),
shell=True,
stdin=PIPE,
stdout=PIPE)
@ -46,7 +46,7 @@ def setup_build_path(build_path):
fname = os.path.join(build_path, 'CMakeCache.txt')
if os.path.exists(fname):
sys.stderr.write('aborting setup\n')
sys.stderr.write('build directory {} which contains CMakeCache.txt already exists\n'.format(build_path))
sys.stderr.write('build directory {0} which contains CMakeCache.txt already exists\n'.format(build_path))
sys.stderr.write('remove the build directory and then rerun setup\n')
sys.exit(1)
else:
@ -74,7 +74,7 @@ def adapt_cmake_command_to_platform(cmake_command, platform):
"""
if platform == 'win32':
pos = cmake_command.find('cmake')
s = ['set {} &&'.format(e) for e in cmake_command[:pos].split()]
s = ['set {0} &&'.format(e) for e in cmake_command[:pos].split()]
s.append(cmake_command[pos:])
return ' '.join(s)
else:
@ -159,7 +159,7 @@ def configure(root_directory, build_path, cmake_command, only_show):
cmake_command = adapt_cmake_command_to_platform(cmake_command, sys.platform)
print('{}\n'.format(cmake_command))
print('{0}\n'.format(cmake_command))
if only_show:
sys.exit(0)