def __init__(self, key, config): params = dict() if config['mode'] in ('test', '_all_'): params['mode'] = config['mode'] TendersClient.__init__(self, key, config['host_url'], config['api_version'], params) if config.get('resource'): self.prefix_path = '/api/{}/{}'.format(config['api_version'], config['resource']) if config['timeout']: socket.setdefaulttimeout(float(config['timeout']))
def __init__(self, key, config): params = {'limit': 1000} if config['mode'] in ('test', '_all_'): params['mode'] = config['mode'] if config['timeout']: socket.setdefaulttimeout(float(config['timeout'])) TendersClient.__init__(self, key, config['host_url'], config['api_version'], params) if config.get('resource'): self.prefix_path = '/api/{}/{}'.format(config['api_version'], config['resource']) self.allow_preload = config.get('preload', None) self.api_version = config['api_version']