From b1943032e04d5e13a5ecbbdc69f9dc15aadaad0f Mon Sep 17 00:00:00 2001 From: David King Date: Sun, 10 Aug 2014 16:37:59 +0100 Subject: [PATCH 1/5] add interface posts.update --- disqusapi/interfaces.json | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/disqusapi/interfaces.json b/disqusapi/interfaces.json index a633891..21a5f25 100644 --- a/disqusapi/interfaces.json +++ b/disqusapi/interfaces.json @@ -305,6 +305,17 @@ "json", "jsonp" ] + }, + "update": { + "required": [ + "post", + "message" + ], + "method": "POST", + "formats": [ + "json", + "jsonp" + ] } }, "blacklists": { From 70fb197076a1ae18b937f7d0a282f1168693e16f Mon Sep 17 00:00:00 2001 From: David King Date: Sun, 10 Aug 2014 16:41:24 +0100 Subject: [PATCH 2/5] fix whitespace --- disqusapi/interfaces.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/disqusapi/interfaces.json b/disqusapi/interfaces.json index 21a5f25..5719d2c 100644 --- a/disqusapi/interfaces.json +++ b/disqusapi/interfaces.json @@ -309,7 +309,7 @@ "update": { "required": [ "post", - "message" + "message" ], "method": "POST", "formats": [ From eb388c4e8d626434481d28da997b90b4c849a589 Mon Sep 17 00:00:00 2001 From: David King Date: Wed, 20 Aug 2014 19:08:30 +0100 Subject: [PATCH 3/5] add forums.addModerator and forums.removeModerator calls --- disqusapi/interfaces.json | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/disqusapi/interfaces.json b/disqusapi/interfaces.json index 5719d2c..038484e 100644 --- a/disqusapi/interfaces.json +++ b/disqusapi/interfaces.json @@ -571,6 +571,17 @@ } }, "forums": { + "addModerator": { + "required": [ + "forum", + "user" + ], + "method": "POST", + "formats": [ + "json", + "jsonp" + ] + }, "create": { "required": [ "website", @@ -654,6 +665,16 @@ "json", "jsonp" ] + }, + "removeModerator": { + "required": [ + "moderator" + ], + "method": "POST", + "formats": [ + "json", + "jsonp" + ] } }, "categories": { From d8ef0224634c90f9f86b9602c1c957fa533afae5 Mon Sep 17 00:00:00 2001 From: David King Date: Sat, 30 Aug 2014 18:38:11 +0100 Subject: [PATCH 4/5] Fix handling of absent public_key. Some API calls (notably posts.create with certain args like ip_address) will not work as expected if both public_key and secret_key are passed, so don't complain if only secret key is provided. --- disqusapi/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/disqusapi/__init__.py b/disqusapi/__init__.py index 579942f..5879d99 100644 --- a/disqusapi/__init__.py +++ b/disqusapi/__init__.py @@ -175,8 +175,8 @@ def __init__(self, secret_key=None, public_key=None, format='json', version='3.0 timeout=None, **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.') + 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() From aa7fa93972ec6805c3c5f89cb2e7089a8189c275 Mon Sep 17 00:00:00 2001 From: David King Date: Wed, 3 Sep 2014 16:20:23 +0100 Subject: [PATCH 5/5] fix PEP8 violation (line length) --- disqusapi/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/disqusapi/__init__.py b/disqusapi/__init__.py index 5879d99..9082a6d 100644 --- a/disqusapi/__init__.py +++ b/disqusapi/__init__.py @@ -176,7 +176,8 @@ def __init__(self, secret_key=None, public_key=None, format='json', version='3.0 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.") + 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()