Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add some missing interfaces; alter handling of missing public_key #16

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions disqusapi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,9 @@ 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()
Expand Down
32 changes: 32 additions & 0 deletions disqusapi/interfaces.json
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,17 @@
"json",
"jsonp"
]
},
"update": {
"required": [
"post",
"message"
],
"method": "POST",
"formats": [
"json",
"jsonp"
]
}
},
"blacklists": {
Expand Down Expand Up @@ -560,6 +571,17 @@
}
},
"forums": {
"addModerator": {
"required": [
"forum",
"user"
],
"method": "POST",
"formats": [
"json",
"jsonp"
]
},
"create": {
"required": [
"website",
Expand Down Expand Up @@ -643,6 +665,16 @@
"json",
"jsonp"
]
},
"removeModerator": {
"required": [
"moderator"
],
"method": "POST",
"formats": [
"json",
"jsonp"
]
}
},
"categories": {
Expand Down