From e86c2bce041db04aa0f5971fea0021e5c7568d1e Mon Sep 17 00:00:00 2001 From: Lewis Menelaws Date: Sun, 5 Jun 2022 14:06:51 -0400 Subject: [PATCH] Removed unused imports. --- reddit/subreddit.py | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/reddit/subreddit.py b/reddit/subreddit.py index 16bbb79..a518d24 100644 --- a/reddit/subreddit.py +++ b/reddit/subreddit.py @@ -1,10 +1,8 @@ -from webbrowser import get - -from click import style from utils.console import print_markdown, print_step, print_substep from dotenv import load_dotenv import os, random, praw, re + def get_subreddit_threads(): global submission """ @@ -13,7 +11,6 @@ def get_subreddit_threads(): load_dotenv() - if os.getenv("REDDIT_2FA", default="no").casefold() == "yes": print( "\nEnter your two-factor authentication code from your authenticator app.\n" @@ -48,7 +45,11 @@ def get_subreddit_threads(): # ! Prompt the user to enter a subreddit try: subreddit = reddit.subreddit( - re.sub(r"r\/", "", input("What subreddit would you like to pull from? ")) + re.sub( + r"r\/", + "", + input("What subreddit would you like to pull from? "), + ) ) except ValueError: subreddit = reddit.subreddit("askreddit") @@ -64,14 +65,14 @@ def get_subreddit_threads(): content["comments"] = [] for top_level_comment in submission.comments: - if not top_level_comment.stickied: - content["comments"].append( - { - "comment_body": top_level_comment.body, - "comment_url": top_level_comment.permalink, - "comment_id": top_level_comment.id, - } - ) + if not top_level_comment.stickied: + content["comments"].append( + { + "comment_body": top_level_comment.body, + "comment_url": top_level_comment.permalink, + "comment_id": top_level_comment.id, + } + ) except AttributeError as e: pass