+ def _CalcConfig(delta, name, config):
+ """Calculate configuration changes
+
+ Args:
+ delta: Type of the delta, e.g. '+'
+ name: name of the file which changed (e.g. .config)
+ config: configuration change dictionary
+ key: config name
+ value: config value
+ Returns:
+ String containing the configuration changes which can be
+ printed
+ """
+ out = ''
+ for key in sorted(config.keys()):
+ out += '%s=%s ' % (key, config[key])
+ return '%5s %s: %s' % (delta, name, out)
+
+ def _ShowConfig(name, config_plus, config_minus, config_change):
+ """Show changes in configuration
+
+ Args:
+ config_plus: configurations added, dictionary
+ key: config name
+ value: config value
+ config_minus: configurations removed, dictionary
+ key: config name
+ value: config value
+ config_change: configurations changed, dictionary
+ key: config name
+ value: config value
+ """
+ if config_plus:
+ Print(_CalcConfig('+', name, config_plus),
+ colour=self.col.GREEN)
+ if config_minus:
+ Print(_CalcConfig('-', name, config_minus),
+ colour=self.col.RED)
+ if config_change:
+ Print(_CalcConfig('+/-', name, config_change),
+ colour=self.col.YELLOW)
+