Skip to content
This repository has been archived by the owner on Jun 9, 2023. It is now read-only.

Commit

Permalink
Update markdown list prefix to work with the new reddit
Browse files Browse the repository at this point in the history
  • Loading branch information
bboe committed Feb 10, 2019
1 parent 106bf62 commit 981b3c0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion prawtools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
"""

__version__ = '0.23.0'
__version__ = '1.0.0'
14 changes: 7 additions & 7 deletions prawtools/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ def top_commenters(self, num):

retval = self.post_header.format('Top Commenters')
for author, comments in top_commenters:
retval += '0. {} ({}, {} comment{})\n'.format(
retval += '1. {} ({}, {} comment{})\n'.format(
self._user(author),
self._points(sum(x.score for x in comments)),
len(comments), 's' if len(comments) != 1 else '')
Expand All @@ -308,17 +308,17 @@ def top_submitters(self, num):

retval = self.post_header.format('Top Submitters\' Top Submissions')
for (author, submissions) in top_submitters:
retval += '0. {}, {} submission{}: {}\n'.format(
retval += '1. {}, {} submission{}: {}\n'.format(
self._points(sum(x.score for x in submissions)),
len(submissions),
's' if len(submissions) != 1 else '', self._user(author))
for sub in sorted(
submissions, key=lambda x: (-x.score, x.title))[:10]:
title = self._safe_title(sub)
if sub.permalink in sub.url:
retval += tt(' 0. {}').format(title)
retval += tt(' 1. {}').format(title)
else:
retval += tt(' 0. [{}]({})').format(title, sub.url)
retval += tt(' 1. [{}]({})').format(title, sub.url)
retval += ' ({}, [{} comment{}]({}))\n'.format(
self._points(sub.score), sub.num_comments,
's' if sub.num_comments != 1 else '',
Expand All @@ -344,9 +344,9 @@ def top_submissions(self):
for sub in top_submissions:
title = self._safe_title(sub)
if sub.permalink in sub.url:
retval += tt('0. {}').format(title)
retval += tt('1. {}').format(title)
else:
retval += tt('0. [{}]({})').format(title, sub.url)
retval += tt('1. [{}]({})').format(title, sub.url)

retval += ' by {} ({}, [{} comment{}]({}))\n'.format(
self._user(sub.author), self._points(sub.score),
Expand All @@ -365,7 +365,7 @@ def top_comments(self):
retval = self.post_header.format('Top Comments')
for comment in top_comments:
title = self._safe_title(comment.submission)
retval += tt('0. {}: {}\'s [comment]({}) in {}\n').format(
retval += tt('1. {}: {}\'s [comment]({}) in {}\n').format(
self._points(comment.score), self._user(comment.author),
self._permalink(comment), title)
return tt('{}\n').format(retval)
Expand Down

0 comments on commit 981b3c0

Please sign in to comment.