From f1eeff726fd8ecb4e1aa0b4311519ac34aca9543 Mon Sep 17 00:00:00 2001 From: Sergei Trofimov Date: Mon, 24 Apr 2017 10:43:21 +0100 Subject: [PATCH] TargetDescription: generate default config Added a method to TargetDescrition to generate a dict with the default config for that description. --- wa/framework/target/descriptor.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/wa/framework/target/descriptor.py b/wa/framework/target/descriptor.py index 9e01ebac..a0820b7e 100644 --- a/wa/framework/target/descriptor.py +++ b/wa/framework/target/descriptor.py @@ -82,6 +82,14 @@ class TargetDescription(object): self._set('platform_params', platform_params) self._set('conn_params', conn_params) + def get_default_config(self): + param_attrs = ['target_params', 'platform_params', 'conn_params'] + config = {} + for pattr in param_attrs: + for n, p in getattr(self, pattr).itervalues(): + config[n] = p.default + return config + def _set(self, attr, vals): if vals is None: vals = {}