Add password prompt

Add prompt for password if the user didn't specify it using the
-p/--password option
pull/11/head
Jonas Karlsson 2020-08-29 11:51:34 +02:00
rodzic 310b2005e0
commit ea519c65e9
1 zmienionych plików z 4 dodań i 0 usunięć

Wyświetl plik

@ -7,6 +7,7 @@ import shutil
import urllib
import argparse
import requests
import getpass
from rich.console import Console
from rich.table import Column, Table
@ -241,6 +242,9 @@ if __name__ == "__main__":
table.add_column("MAC", style="dim", width=17, justify='center')
table.add_column("auth_key", width=50, justify='center')
if args.password is None:
args.password = getpass.getpass()
device = HuamiAmazfit(method=args.method,
email=args.email,
password=args.password)