Esempio n. 1
0
class Configable(object):
    CONFIG_FILE = None

    def __init__(self):
        self._config = ComposerConfig()
        self.config_file = None

    @property
    def config(self):
        if self._config.configured:
            return self._config
        if self.config_file and self.config_file.exists():
            self._config.configure(self.config_file)
        return self._config

    @property
    def configured(self):
        return bool(self.config is not None and self.config.configured)