Merge remote-tracking branch 'origin/master' into cleanup

This commit is contained in:
Michael Lazar
2015-04-05 12:30:48 -07:00
5 changed files with 30 additions and 3 deletions

View File

@@ -304,6 +304,18 @@ class SubredditContent(BaseContent):
return cls(display_name, submissions, loader)
@classmethod
def from_redditor(cls, reddit, loader, order='new'):
submissions = reddit.user.get_submitted(sort=order)
display_name = '/r/me'
content = cls(display_name, submissions, loader)
try:
content.get(0)
except (praw.errors.APIException, requests.HTTPError,
praw.errors.RedirectException):
raise SubredditError(display_name)
return content
def get(self, index, n_cols=70):
"""
Grab the `i`th submission, with the title field formatted to fit inside