From a8312189eb1edb16dd8265bd592677b9dd2bd5ec Mon Sep 17 00:00:00 2001 From: Dan Rapp Date: Sun, 30 Jan 2022 11:05:59 -0700 Subject: [PATCH] Add keyring support --- fscrawler/crawler.py | 6 +++++- setup.py | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/fscrawler/crawler.py b/fscrawler/crawler.py index 520a9c0..65e5123 100644 --- a/fscrawler/crawler.py +++ b/fscrawler/crawler.py @@ -7,6 +7,7 @@ import time import argparse import getpass +import keyring from collections import defaultdict from pathlib import Path @@ -129,7 +130,10 @@ def main(): sys.exit("Invalid FamilySearch ID: " + fid) args.username = args.username if args.username else input("Enter FamilySearch username: ") - args.password = args.password if args.password else getpass.getpass("Enter FamilySearch password: ") + if not args.password: + args.password = keyring.get_password("fs-crawler", args.username) + if not args.password: + args.password = getpass.getpass("Enter FamilySearch password: ") out_dir = Path(args.outdir) basename = args.basename diff --git a/setup.py b/setup.py index d8ff6d2..d6a546b 100644 --- a/setup.py +++ b/setup.py @@ -36,6 +36,7 @@ platforms=["Windows", "Linux", "Mac OS-X"], install_requires=[ 'httpx', + 'keyring', 'tqdm', 'iteration_utilities' ],