Skip to content

Commit 256a211

Browse files
committed
Merge pull request kivy#524 from inclement/recipe_fix
Improved recipe output
2 parents bc32ef7 + b05f8d7 commit 256a211

File tree

1 file changed

+21
-19
lines changed

1 file changed

+21
-19
lines changed

pythonforandroid/toolchain.py

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2840,32 +2840,34 @@ def recipes(self, args):
28402840

28412841
args = parser.parse_args(args)
28422842

2843+
Fore = Out_Fore
2844+
Style = Out_Style
2845+
if not args.color:
2846+
Fore = Null_Fore
2847+
Style = Null_Style
2848+
28432849
if args.compact:
28442850
print(" ".join(list(Recipe.list_recipes())))
28452851
else:
28462852
ctx = self.ctx
28472853
for name in sorted(Recipe.list_recipes()):
28482854
recipe = Recipe.get_recipe(name, ctx)
28492855
version = str(recipe.version)
2850-
if args.color:
2851-
print('{Fore.BLUE}{Style.BRIGHT}{recipe.name:<12} '
2852-
'{Style.RESET_ALL}{Fore.LIGHTBLUE_EX}'
2853-
'{version:<8}{Style.RESET_ALL}'.format(
2854-
recipe=recipe, Fore=Out_Fore, Style=Out_Style,
2855-
version=version))
2856-
print(' {Fore.GREEN}depends: {recipe.depends}'
2857-
'{Fore.RESET}'.format(recipe=recipe, Fore=Out_Fore))
2858-
if recipe.conflicts:
2859-
print(' {Fore.RED}conflicts: {recipe.conflicts}'
2860-
'{Fore.RESET}'
2861-
.format(recipe=recipe, Fore=Out_Fore))
2862-
else:
2863-
print("{recipe.name:<12} {recipe.version:<8}"
2864-
.format(recipe=recipe))
2865-
print(' depends: {recipe.depends}'
2866-
.format(recipe=recipe))
2867-
print(' conflicts: {recipe.conflicts}'
2868-
.format(recipe=recipe))
2856+
print('{Fore.BLUE}{Style.BRIGHT}{recipe.name:<12} '
2857+
'{Style.RESET_ALL}{Fore.LIGHTBLUE_EX}'
2858+
'{version:<8}{Style.RESET_ALL}'.format(
2859+
recipe=recipe, Fore=Fore, Style=Style,
2860+
version=version))
2861+
print(' {Fore.GREEN}depends: {recipe.depends}'
2862+
'{Fore.RESET}'.format(recipe=recipe, Fore=Fore))
2863+
if recipe.conflicts:
2864+
print(' {Fore.RED}conflicts: {recipe.conflicts}'
2865+
'{Fore.RESET}'
2866+
.format(recipe=recipe, Fore=Fore))
2867+
if recipe.opt_depends:
2868+
print(' {Fore.YELLOW}optional depends: '
2869+
'{recipe.opt_depends}{Fore.RESET}'
2870+
.format(recipe=recipe, Fore=Fore))
28692871

28702872
def bootstraps(self, args):
28712873
'''List all the bootstraps available to build with.'''

0 commit comments

Comments
 (0)