Example #1
0
    def __init__(self, config=None, api=None):
        Service.__init__(self, config)

        if api is None:
            self.api = WikipediaAPI()
        else:
            self.api = api
Example #2
0
    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")
Example #3
0
    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")
Example #4
0
    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
Example #5
0
    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")
Example #6
0
 def __init__(self, config):
     Service.__init__(self, config)
Example #7
0
 def __init__(self, config):
     Service.__init__(self, config)
Example #8
0
 def __init__(self, config: BrainServiceConfiguration):
     Service.__init__(self, config)
Example #9
0
 def __init__(self, config: BrainServiceConfiguration):
     Service.__init__(self, config)