def __init__(self, secret_key=None, public_key=None, format='json', version='3.0', timeout=None, interfaces=INTERFACES, **kwargs): self.secret_key = secret_key self.public_key = public_key if not public_key: warnings.warn('You should pass ``public_key`` in addition to your secret key.') self.format = format self.version = version self.timeout = timeout or socket.getdefaulttimeout() self.interfaces = interfaces self.interfaces_by_method = build_interfaces_by_method(self.interfaces) super(DisqusAPI, self).__init__(self)
def __init__(self, secret_key=None, public_key=None, format='json', version='3.0', timeout=None, interfaces=INTERFACES, http_client=https_client, **kwargs): self.secret_key = secret_key self.public_key = public_key if not public_key and not secret_key: warnings.warn("You should at least pass ``public_key`` if you " "don't pass your secret key.") self.format = format self.version = version self.timeout = timeout or socket.getdefaulttimeout() self.interfaces = interfaces self.interfaces_by_method = build_interfaces_by_method(self.interfaces) self.http_client = http_client super(DisqusAPI, self).__init__(self)
def update_interface(self, new_interface): self.interfaces.update(new_interface) self.interfaces_by_method = build_interfaces_by_method(self.interfaces)