def __init__(self, config=None, api=None): Service.__init__(self, config) if api is None: self.api = WikipediaAPI() else: self.api = api
def __init__(self, config: BrainServiceConfiguration, api=None): Service.__init__(self, config) if api is None: self.api = PandoraAPI() else: self.api = api if config.url is None: raise Exception("Undefined url parameter")
def __init__(self, config: BrainServiceConfiguration, api=None): Service.__init__(self, config) if api is None: self.api = PannousAPI() else: self.api = api self.url = None if 'URL' in self._config.parameters(): self.url = self._config.parameter('URL') else: raise Exception("Undefined url parameter")
def __init__(self, config: BrainServiceConfiguration, api=None): Service.__init__(self, config) if api is None: self.api = RestAPI() else: self.api = api self.payload = {} if config.method is None: self.method = "GET" else: self.method = config.method if config.host is None: raise Exception("Undefined host parameter") self.host = config.host
def __init__(self, config: BrainServiceConfiguration, api=None): Service.__init__(self, config) if api is None: self.api = RestAPI() else: self.api = api self.payload = {} self.method = "GET" self.host = None for param in self._config.parameters(): if param == 'METHOD': self.method = self._config.parameter('METHOD') elif param == 'HOST': self.host = self._config.parameter('HOST') else: self.payload[param] = self._config.parameter(param) if self.host is None: raise Exception("Undefined host parameter")
def __init__(self, config): Service.__init__(self, config)
def __init__(self, config: BrainServiceConfiguration): Service.__init__(self, config)