From 0e163f4560c2ce30a6adcc38506131fa90ca08fb Mon Sep 17 00:00:00 2001 From: Kjell Wooding Date: Sat, 22 Dec 2018 13:25:21 -0700 Subject: [PATCH 1/2] Add an info target to display arch/context information --- toolchain.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/toolchain.py b/toolchain.py index 1f6107f..b6bb6a0 100755 --- a/toolchain.py +++ b/toolchain.py @@ -1432,6 +1432,28 @@ Xcode: print("--") print("Project {} updated".format(filename)) + def info(self): + ctx = Context() + print("Build Context") + print("-------------") + from pprint import pformat, pprint + for attr in dir(ctx): + if not attr.startswith("_"): + if not callable(attr) and attr != 'archs': + print(f"{attr}: {pformat(getattr(ctx, attr))}") + print("Architectures") + print("=============") + for arch in ctx.archs: + ul = '-' * (len(str(arch))+6) + print(f"{ul}\nArch: {str(arch)}\n{ul}") + for attr in dir(arch): + if not attr.startswith("_"): + if not callable(attr) and attr not in ['arch', 'ctx']: + print(f"{attr}: {pformat(getattr(arch, attr))}") + print("env:") + pprint(arch.get_env()) + + def pip(self): ctx = Context() for recipe in Recipe.list_recipes(): From 7b58f0f6ccf6ed32c267a2367e621d88101ecf91 Mon Sep 17 00:00:00 2001 From: Kjell Wooding Date: Wed, 6 Feb 2019 23:35:48 -0500 Subject: [PATCH 2/2] clean up output somewhat and add to usage --- toolchain.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/toolchain.py b/toolchain.py index b6bb6a0..5927a25 100755 --- a/toolchain.py +++ b/toolchain.py @@ -20,6 +20,8 @@ import fnmatch import tempfile import time from datetime import datetime +from pprint import pformat + try: from urllib.request import FancyURLopener, urlcleanup except ImportError: @@ -1240,6 +1242,7 @@ Available commands: distclean Clean the build and the result recipes List all the available recipes status List all the recipes and their build status + build_info Display the current build context and Architecture info Xcode: create Create a new xcode project @@ -1432,26 +1435,23 @@ Xcode: print("--") print("Project {} updated".format(filename)) - def info(self): + def build_info(self): ctx = Context() print("Build Context") print("-------------") - from pprint import pformat, pprint for attr in dir(ctx): if not attr.startswith("_"): if not callable(attr) and attr != 'archs': - print(f"{attr}: {pformat(getattr(ctx, attr))}") - print("Architectures") - print("=============") + print("{}: {}".format(attr, pformat(getattr(ctx, attr)))) for arch in ctx.archs: ul = '-' * (len(str(arch))+6) - print(f"{ul}\nArch: {str(arch)}\n{ul}") + print("\narch: {}\n{}".format(str(arch), ul)) for attr in dir(arch): if not attr.startswith("_"): - if not callable(attr) and attr not in ['arch', 'ctx']: - print(f"{attr}: {pformat(getattr(arch, attr))}") - print("env:") - pprint(arch.get_env()) + if not callable(attr) and attr not in ['arch', 'ctx', 'get_env']: + print("{}: {}".format(attr, pformat(getattr(arch, attr)))) + env = arch.get_env() + print("env ({}): {}".format(arch, pformat(env))) def pip(self):