Skip to content

Commit a9e02d2

Browse files
committed
Changed some % formatting to use format strings
1 parent c03c570 commit a9e02d2

File tree

1 file changed

+17
-16
lines changed

1 file changed

+17
-16
lines changed

pythonforandroid/toolchain.py

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -843,13 +843,13 @@ def prepare_build_environment(self, user_sdk_dir, user_ndk_dir,
843843
exit(1)
844844

845845
toolchain_versions = []
846-
toolchain_path = join( self.ndk_dir, 'toolchains')
846+
toolchain_path = join(self.ndk_dir, 'toolchains')
847847
if os.path.isdir(toolchain_path):
848848
toolchain_contents = os.listdir(toolchain_path)
849849
for toolchain_content in toolchain_contents:
850850
if toolchain_content.startswith(toolchain_prefix) and os.path.isdir(os.path.join(toolchain_path, toolchain_content)):
851851
toolchain_version = toolchain_content[len(toolchain_prefix)+1:]
852-
debug("Found toolchain version: %s" %(toolchain_version))
852+
debug('Found toolchain version: {}'.format(toolchain_version))
853853
toolchain_versions.append(toolchain_version)
854854
else:
855855
warning('Could not find toolchain subdirectory!')
@@ -862,11 +862,11 @@ def prepare_build_environment(self, user_sdk_dir, user_ndk_dir,
862862
toolchain_versions_gcc.append(toolchain_version)
863863

864864
if toolchain_versions:
865-
info('Found the following toolchain versions: %s' %(repr(toolchain_versions)))
866-
info('Picking the latest gcc toolchain, here %s' %(repr(toolchain_versions_gcc[-1])))
865+
info('Found the following toolchain versions: {}'.format(toolchain_versions))
866+
info('Picking the latest gcc toolchain, here {}'.format(toolchain_versions_gcc[-1]))
867867
toolchain_version = toolchain_versions_gcc[-1]
868868
else:
869-
warning('Could not find any toolchain for %s!' %(toolchain_prefix))
869+
warning('Could not find any toolchain for {}!'.format(toolchain_prefix))
870870
ok = False
871871

872872
self.toolchain_prefix = toolchain_prefix
@@ -2854,17 +2854,18 @@ def build_status(self, args):
28542854

28552855
print('{Style.BRIGHT}Recipes that are probably already built:'
28562856
'{Style.RESET_ALL}'.format(Style=Style))
2857-
for filen in sorted(os.listdir(join(self.ctx.build_dir, 'other_builds'))):
2858-
name = filen.split('-')[0]
2859-
dependencies = filen.split('-')[1:]
2860-
recipe_str = (' {Style.BRIGHT}{Fore.GREEN}{name}'
2861-
'{Style.RESET_ALL}'.format(
2862-
Style=Style, name=name, Fore=Fore))
2863-
if dependencies:
2864-
recipe_str += (' ({Fore.BLUE}with ' + ', '.join(dependencies) +
2865-
'){Fore.RESET}').format(Fore=Fore)
2866-
recipe_str += '{Style.RESET_ALL}'.format(Style=Style)
2867-
print(recipe_str)
2857+
if exists(join(self.ctx.build_dir, 'other_builds')):
2858+
for filen in sorted(os.listdir(join(self.ctx.build_dir, 'other_builds'))):
2859+
name = filen.split('-')[0]
2860+
dependencies = filen.split('-')[1:]
2861+
recipe_str = (' {Style.BRIGHT}{Fore.GREEN}{name}'
2862+
'{Style.RESET_ALL}'.format(
2863+
Style=Style, name=name, Fore=Fore))
2864+
if dependencies:
2865+
recipe_str += (' ({Fore.BLUE}with ' + ', '.join(dependencies) +
2866+
'){Fore.RESET}').format(Fore=Fore)
2867+
recipe_str += '{Style.RESET_ALL}'.format(Style=Style)
2868+
print(recipe_str)
28682869

28692870

28702871
def main():

0 commit comments

Comments
 (0)