Re-implemented getpass for password.

This commit is contained in:
Michael Lazar
2015-03-03 08:12:24 -08:00
parent 2a608efaff
commit 4124fd7acc

View File

@@ -1,4 +1,5 @@
import argparse
from getpass import getpass
import praw
from requests.exceptions import ConnectionError, HTTPError
@@ -65,8 +66,12 @@ def main():
reddit = praw.Reddit(user_agent='reddit terminal viewer v0.0')
reddit.config.decode_html_entities = True
if args.username and args.password:
if args.username:
if args.password:
reddit.login(args.username, args.password)
else:
password = getpass()
reddit.login(args.username, password)
with curses_session() as stdscr: