Skip to content

Commit ce598b0

Browse files
committed
Tidied up some status command outputs
1 parent d259d9b commit ce598b0

File tree

1 file changed

+17
-8
lines changed

1 file changed

+17
-8
lines changed

pythonforandroid/toolchain.py

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def info_main(*args):
9090
def info_notify(s):
9191
info('{}{}{}{}'.format(Style.BRIGHT, Fore.LIGHTBLUE_EX, s, Style.RESET_ALL))
9292

93-
def pretty_log_dists(dists):
93+
def pretty_log_dists(dists, log_func=info):
9494
infos = []
9595
for dist in dists:
9696
infos.append('{Fore.GREEN}{Style.BRIGHT}{name}{Style.RESET_ALL}: '
@@ -100,7 +100,7 @@ def pretty_log_dists(dists):
100100
Fore=Fore, Style=Style))
101101

102102
for line in infos:
103-
info('\t' + line)
103+
log_func('\t' + line)
104104

105105
def shprint(command, *args, **kwargs):
106106
'''Runs the command (which should be an sh.Command instance), while
@@ -2498,7 +2498,12 @@ def recipes(self, args):
24982498

24992499
def bootstraps(self, args):
25002500
'''List all the bootstraps available to build with.'''
2501-
print(list(Bootstrap.list_bootstraps()))
2501+
for bs in Bootstrap.list_bootstraps():
2502+
bs = Bootstrap.get_bootstrap(bs, self.ctx)
2503+
print('{Fore.BLUE}{Style.BRIGHT}{bs.name}{Style.RESET_ALL}'.format(
2504+
bs=bs, Fore=Fore, Style=Style))
2505+
print(' {Fore.GREEN}depends: {bs.recipe_depends}{Fore.RESET}'.format(
2506+
bs=bs, Fore=Fore))
25022507

25032508
def clean_all(self, args):
25042509
'''Delete all build components; the package cache, package builds,
@@ -2722,12 +2727,12 @@ def distributions(self, args):
27222727
dists = Distribution.get_distributions(ctx)
27232728

27242729
if dists:
2725-
info('{Style.BRIGHT}Distributions currently installed are:'
2726-
'{Style.RESET_ALL}'.format(Style=Style, Fore=Fore))
2727-
pretty_log_dists(dists)
2730+
print('{Style.BRIGHT}Distributions currently installed are:'
2731+
'{Style.RESET_ALL}'.format(Style=Style, Fore=Fore))
2732+
pretty_log_dists(dists, print)
27282733
else:
2729-
info('{Style.BRIGHT}There are no dists currently built.'
2730-
'{Style.RESET_ALL}'.format(Style=Style))
2734+
print('{Style.BRIGHT}There are no dists currently built.'
2735+
'{Style.RESET_ALL}'.format(Style=Style))
27312736

27322737
def delete_dist(self, args):
27332738
dist = self._dist
@@ -2783,6 +2788,10 @@ def logcat(self, args):
27832788
directory. All extra args are passed as arguments to logcat.'''
27842789
self.adb(['logcat'] + args)
27852790

2791+
def status(self, args):
2792+
self.recipes(args)
2793+
self.bootstraps(args)
2794+
self.dists(args)
27862795

27872796
def main():
27882797
ToolchainCL()

0 commit comments

Comments
 (0)