Пример #1
0
 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)
Пример #2
0
 def update_interface(self, new_interface):
     self.interfaces.update(new_interface)
     self.interfaces_by_method = build_interfaces_by_method(self.interfaces)