Refactor the context back into the ConfigurableInterface.

This also adds support for manually constructed configurables to
populate the config tree in the current context.

I'm still toying around with this though, I need to figure out
what to do with optional values and think the whole thing through
to make sure it's worthwhile.
This commit is contained in:
Mike Auty
2016-08-14 21:28:43 +01:00
parent ce16d60eaf
commit ca61cf10b9
6 changed files with 33 additions and 15 deletions
+1 -10
View File
@@ -26,18 +26,9 @@ class PluginInterface(configuration_interface.ConfigurableInterface, validity.Va
"""Class that defines the interface all Plugins must maintain"""
def __init__(self, context, config_path):
super().__init__(config_path)
self._context = self._check_type(context, context_interface.ContextInterface)
super().__init__(context, config_path)
# self.validate()
@property
def context(self):
return self._context
@property
def config(self):
return self._context.config.branch(self._config_path)
@classmethod
def get_requirements(cls):
"""Returns a list of Requirement objects for this plugin"""