diff options
author | Daniel Silverstone <daniel.silverstone@codethink.co.uk> | 2019-05-15 15:36:28 +0100 |
---|---|---|
committer | Daniel Silverstone <daniel.silverstone@codethink.co.uk> | 2019-05-17 17:17:55 +0100 |
commit | 5f85e13108bda52c2db6d9c7b4555c31a83cfff8 (patch) | |
tree | 0586c787e37048ffe3530e559796f1bdb9ac2cef | |
parent | ac2cc9ad755915972455d4c355d43bc681542ef2 (diff) | |
download | buildstream-5f85e13108bda52c2db6d9c7b4555c31a83cfff8.tar.gz |
element.py: Lift __extract_variables to be classmethod
Since __extract_variables only needs to be a class method, lift it
to clarify what it depends on.
Signed-off-by: Daniel Silverstone <daniel.silverstone@codethink.co.uk>
-rw-r--r-- | buildstream/element.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/buildstream/element.py b/buildstream/element.py index 31f3c83a4..1190b0ed0 100644 --- a/buildstream/element.py +++ b/buildstream/element.py @@ -245,7 +245,7 @@ class Element(Plugin): self.__init_defaults(project, plugin_conf, self.get_kind()) # Collect the composited variables and resolve them - variables = self.__extract_variables(meta) + variables = self.__extract_variables(project, meta) _yaml.node_set(variables, 'element-name', self.name) self.__variables = Variables(variables) @@ -2518,11 +2518,11 @@ class Element(Plugin): # This will resolve the final variables to be used when # substituting command strings to be run in the sandbox # - def __extract_variables(self, meta): - default_vars = _yaml.node_get(self.__defaults, Mapping, 'variables', + @classmethod + def __extract_variables(cls, project, meta): + default_vars = _yaml.node_get(cls.__defaults, Mapping, 'variables', default_value={}) - project = self._get_project() if meta.kind == "junction": variables = _yaml.node_copy(project.first_pass_config.base_variables) else: |