From e9776b97b169d00a7e44f96eff09551ddbcab427 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Tue, 24 Aug 2021 10:22:50 +0200 Subject: [PATCH] add comments --- main.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/main.py b/main.py index 6956585..e3123ea 100644 --- a/main.py +++ b/main.py @@ -100,25 +100,25 @@ def save(elements): if __name__ == "__main__": argv = argv[1:] - if len(argv) < 1: + if len(argv) < 1: # no args print("No App to retrieve.") exit(1) - load_dotenv() + load_dotenv() # load .env file try: - try: + try: # for logs debug = environ["DEBUG_MOBILISM"].lower() in ("yes", "true", "1") except: debug = False - try: + try: # try to fetch credentials from de .env first pseudoMobilism = environ["PSEUDO_MOBILISM"] passwordMobilism = environ["PASSWORD_MOBILISM"] - except: + except: # if it failed try to get from the cli if len(argv) >= 3: pseudoMobilism = argv[0] passwordMobilism = argv[1] argv = argv[-2:] - else: + else: # if it failed again there is a problem raise KeyError - save(Scraper(pseudoMobilism, passwordMobilism, " ".join([n for n in argv]), debug).work()) + save(Scraper(pseudoMobilism, passwordMobilism, " ".join([n for n in argv]), debug).work()) # call the work() function except KeyError: print('Please fill in the username and password (with quotes) by args or with .env file and give an app to retrieve.')