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

        if api is None:
            self._api = WikipediaAPI()
        else:
            self._api = api
示例#2
0
    def __init__(self, config: BrainServiceConfiguration, api=None):
        Service.__init__(self, config)

        if api is None:
            self.api = RestAPI()
        else:
            self.api = api

        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

        self.port = None
        if config.port is not None:
            self.port = config.port

        self.url = None
        if config.url is not None:
            self.url = config.url

        self._status_code = ''
        self._latency = ''

        self._start_time = None
        self._end_time = None
示例#3
0
    def __init__(self, config=None, api=None):
        Service.__init__(self, config)

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

        if api is None:
            self.api = PublishedBotAPI()
        else:
            self.api = api

        self._botInfo = None
        self._userId = None
        self._status_code = ''
示例#7
0
    def __init__(self, config: BrainServiceConfiguration, api=None):
        Service.__init__(self, config)

        if api is None:
            self.api = WeatherAPI()
        else:
            self.api = api

        if config is None:
            raise Exception("Undefined url parameter")
        else:
            self.config=config
示例#8
0
    def __init__(self, config=None, api=None):
        Service.__init__(self, config)

        if api is None:
            self._api = DuckDuckGoAPI()
        else:
            self._api = api

        self._url = None
        if config._url is None:
            raise Exception("Undefined url parameter")
        else:
            self._url = config.url
示例#9
0
    def __init__(self, config=None, api=None):
        Service.__init__(self, config)

        if api is None:
            self._api = DuckDuckGoAPI()
        else:
            self._api = api

        self._url = None
        if config._url is None:
            raise Exception("Undefined url parameter")
        else:
            self._url = config.url
示例#10
0
    def __init__(self, config: BrainServiceConfiguration, api=None):
        Service.__init__(self, config)

        if api is None:
            self.api = PublishedRestAPI()
        else:
            self.api = api

        self._host = None
        self._method = None
        self._query = None
        self._header = None
        self._body = None
        self._status_code = ''
示例#11
0
    def __init__(self, config: BrainServiceConfiguration, api=None):
        Service.__init__(self, config)

        if api is None:
            self.api = PublishedRestAPI()
        else:
            self.api = api

        self._params = None
        self._status_code = ''
        self._latency = ''

        self._start_time = None
        self._end_time = None
示例#12
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
示例#13
0
文件: rest.py 项目: Freiza/program-y
    def __init__(self, config: BrainServiceConfiguration, api=None):
        Service.__init__(self, config)

        if api is None:
            self.api = RestAPI()
        else:
            self.api = api

        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

        self.port = None
        if config.port is not None:
           self.port = config.port

        self.url = None
        if config.url is not None:
           self.url = config.url
示例#14
0
    def __init__(self, config: BrainServiceConfiguration, api=None):
        Service.__init__(self, config)

        if api is None:
            self.api = RestAPI()
        else:
            self.api = api

        if config.method is None:
            self.method = "GET"
        else:
            self.method = config.method

        self.host = None
        if config.host is not None:
            self.host = config.host

        self.port = None
        if config.port is not None:
            self.port = config.port

        self.url = None
        if config.url is not None:
            self.url = config.url
示例#15
0
 def __init__(self, config):
     Service.__init__(self, config)
示例#16
0
 def __init__(self, config=None, api=None):
     Service.__init__(self, config)
示例#17
0
 def __init__(self, config):
     Service.__init__(self, config)
示例#18
0
 def __init__(self, config: BrainServiceConfiguration):
     Service.__init__(self, config)
示例#19
0
 def __init__(self, config):
     Service.__init__(self, config)
     self._response = "asked"
示例#20
0
 def __init__(self, config: BrainServiceConfiguration):
     Service.__init__(self, config)