+ def configure_plugins(self):
+ for plugin in self.plugins:
+ self._configure_item(plugin)
+
+ def configure_drivers(self):
+ for driver in self.drivers:
+ self._configure_item(driver)
+
+ def configure_ui(self):
+ self._configure_item(self.ui)
+
+ def _configure_item(self, item):
+ conditions = self.config.items('conditions')
+ try:
+ item.config = dict(self.config.items(item.setting_section))
+ except NoSectionError:
+ item.config = {}
+ for key,value in conditions:
+ if key not in item.config:
+ item.config[key] = value
+
+ def close(self, save_config=False):
+ if save_config == True:
+ self.config.write() # Does not preserve original comments