Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

tmp

  • Loading branch information...
commit f33f99e1e061fc2da5d246c6f4c93ec1df9dacc1 1 parent 7ed71b8
Bryce Boe bboe authored
Showing with 25 additions and 16 deletions.
  1. +25 −16 reddit/__init__.py
41 reddit/__init__.py
View
@@ -93,6 +93,11 @@ class Config(object): # pylint: disable-msg=R0903
'user': 'user/%s/',
'user_about': 'user/%s/about/',
'vote': 'api/vote/',
+ 'wiki': 'r/%s/wiki',
+ 'wiki_edit': 'r/%s/wiki/edit',
+ 'wiki_history': 'r/%s/wiki/revisions',
+ 'wiki_settings': 'r/%s/wiki/settings',
+ 'wiki_talk': 'r/%s/wiki/discussions',
'wikibanned': 'r/%s/about/banned/',
'wikicontributors': 'r/%s/about/wikicontribute/'}
SSL_PATHS = ('login', )
@@ -301,7 +306,26 @@ def request_json(self, page_url, params=None, url_data=None,
return json.loads(response.decode('utf-8'), object_hook=hook)
-class SubredditExtension(BaseReddit):
+class WikiExtension(BaseReddit):
+ def __init__(self, *args, **kwargs):
+ super(WikiExtension, self).__init__(*args, **kwargs)
+
+ @reddit.decorators.require_login
+ @reddit.decorators.require_moderator
+ def get_wiki_banned(self, subreddit):
+ """Get the list of wiki banned users for the given subreddit."""
+ return self.request_json(self.config['wikibanned'] %
+ six.text_type(subreddit))
+
+ @reddit.decorators.require_login
+ @reddit.decorators.require_moderator
+ def get_wiki_contributors(self, subreddit):
+ """Get the list of wiki contributors for the given subreddit."""
+ return self.request_json(self.config['wikicontributors'] %
+ six.text_type(subreddit))
+
+
+class SubredditExtension(WikiExtension):
def __init__(self, *args, **kwargs):
super(SubredditExtension, self).__init__(*args, **kwargs)
@@ -425,21 +449,6 @@ def get_stylesheet(self, subreddit):
@reddit.decorators.require_login
@reddit.decorators.require_moderator
- def get_wiki_banned(self, subreddit):
- """Get the list of wiki banned users for the given subreddit."""
- return self.request_json(self.config['wikibanned'] %
- six.text_type(subreddit))
-
- @reddit.decorators.require_login
- @reddit.decorators.require_moderator
- def get_wiki_contributors(self, subreddit):
- """Get the list of wiki contributors for the given subreddit."""
- return self.request_json(self.config['wikicontributors'] %
- six.text_type(subreddit))
-
-
- @reddit.decorators.require_login
- @reddit.decorators.require_moderator
def set_flair(self, subreddit, item, flair_text='', flair_css_class=''):
"""Set flair for the user in the given subreddit.
Please sign in to comment.
Something went wrong with that request. Please try again.