from .cluster import Cluster class Esales(object): def __init__(self, app=None): self.cluster = Cluster() if app: self.init_app(app) def init_app(self, app): if not 'ESALES_URL' in app.config: raise Exception('ESALES_URL missing in config') self.cluster.url = app.config.get('ESALES_URL')