mirror of
https://github.com/davegallant/rfd.git
synced 2025-08-07 00:58:14 +00:00
Bump pylint from 2.9.6 to 2.11.1 (#108)
* Bump pylint from 2.9.6 to 2.11.1 Bumps [pylint](https://github.com/PyCQA/pylint) from 2.9.6 to 2.11.1. - [Release notes](https://github.com/PyCQA/pylint/releases) - [Changelog](https://github.com/PyCQA/pylint/blob/main/ChangeLog) - [Commits](https://github.com/PyCQA/pylint/compare/v2.9.6...v2.11.1) --- updated-dependencies: - dependency-name: pylint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * Use f strings everywhere * Add black.yml Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Dave G <davegallant@gmail.com>
This commit is contained in:
11
rfd/posts.py
11
rfd/posts.py
@@ -3,19 +3,22 @@ import os
|
||||
from colorama import Fore, Style
|
||||
from .scores import get_vote_color
|
||||
|
||||
|
||||
class Post:
|
||||
def __init__(self, body, score, user):
|
||||
self.body = body
|
||||
self.score = score
|
||||
self.user = user
|
||||
|
||||
|
||||
def get_terminal_width():
|
||||
_, columns = os.popen("stty size", "r").read().split()
|
||||
return int(columns)
|
||||
|
||||
|
||||
def generate_posts_output(posts):
|
||||
output = ""
|
||||
output += ("-" * get_terminal_width())
|
||||
output += "-" * get_terminal_width()
|
||||
for post in posts:
|
||||
output += (
|
||||
" -"
|
||||
@@ -23,10 +26,10 @@ def generate_posts_output(posts):
|
||||
+ Fore.RESET
|
||||
+ post.body
|
||||
+ Fore.YELLOW
|
||||
+ " ({})".format(post.user)
|
||||
+ f" ({post.user})"
|
||||
)
|
||||
output += (Style.RESET_ALL)
|
||||
output += Style.RESET_ALL
|
||||
output += "\n"
|
||||
output += ("-" * get_terminal_width())
|
||||
output += "-" * get_terminal_width()
|
||||
output += "\n"
|
||||
return output
|
||||
|
Reference in New Issue
Block a user