Skip to content

Commit

Permalink
Add explict listing selectors and use account default for non-explici…
Browse files Browse the repository at this point in the history
…t selectors
  • Loading branch information
bboe committed Jun 25, 2012
1 parent b08363f commit 447116b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
2 changes: 1 addition & 1 deletion reddit/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import reddit.objects
from reddit.settings import CONFIG

__version__ = '1.3.11'
__version__ = '1.4.0'
UA_STRING = '%%s PRAW/%s Python/%s %s' % (__version__,
sys.version.split()[0],
platform.platform(True))
Expand Down
24 changes: 20 additions & 4 deletions reddit/objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -628,12 +628,28 @@ class Subreddit(Messageable):
remove_moderator = _modify_relationship('moderator', unlink=True,
is_sub=True)

# Generic listing selectors
get_comments = _get_section('comments')
get_controversial = _get_sorter('controversial')
get_hot = _get_sorter('')
get_controversial = _get_sorter('controversial', t='day')
get_new = _get_sorter('new', sort='rising')
get_top = _get_sorter('top', t='day')
get_new = _get_sorter('new')
get_top = _get_sorter('top')

# Explicit listing selectors
get_controversial_from_all = _get_sorter('controversial', t='all')
get_controversial_from_day = _get_sorter('controversial', t='day')
get_controversial_from_hour = _get_sorter('controversial', t='hour')
get_controversial_from_month = _get_sorter('controversial', t='month')
get_controversial_from_week = _get_sorter('controversial', t='week')
get_controversial_from_year = _get_sorter('controversial', t='year')
get_new_by_date = _get_sorter('new', sort='new')
get_comments = _get_section('comments')
get_new_by_rising = _get_sorter('new', sort='rising')
get_top_from_all = _get_sorter('top', t='all')
get_top_from_day = _get_sorter('top', t='day')
get_top_from_hour = _get_sorter('top', t='hour')
get_top_from_month = _get_sorter('top', t='month')
get_top_from_week = _get_sorter('top', t='week')
get_top_from_year = _get_sorter('top', t='year')

def __init__(self, reddit_session, subreddit_name=None, json_dict=None,
fetch=False):
Expand Down

0 comments on commit 447116b

Please sign in to comment.