From 0e163f4560c2ce30a6adcc38506131fa90ca08fb Mon Sep 17 00:00:00 2001 From: Kjell Wooding Date: Sat, 22 Dec 2018 13:25:21 -0700 Subject: [PATCH] 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():