From ba3e5c77d1bed3e26f0c8f275544f73f1241c302 Mon Sep 17 00:00:00 2001 From: powe97 <116031952+powe97@users.noreply.github.com> Date: Sat, 16 Mar 2024 01:17:49 -0400 Subject: [PATCH] Lint --- transfer_scraper/convert_json.py | 7 ++++++- transfer_scraper/scrape_page.py | 4 +++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/transfer_scraper/convert_json.py b/transfer_scraper/convert_json.py index 703cc78..6395d0d 100644 --- a/transfer_scraper/convert_json.py +++ b/transfer_scraper/convert_json.py @@ -2,9 +2,13 @@ import json import sys import collections + def main(): if len(sys.argv) != 3: - print(f"USAGE: python {sys.argv[0]} ", file=sys.stderr) + print( + f"USAGE: python {sys.argv[0]} ", + file=sys.stderr, + ) return 1 with open(sys.argv[1], "r") as scraper_json: by_institution = json.load(scraper_json) @@ -20,5 +24,6 @@ def main(): with open(sys.argv[2], "w") as out_json: json.dump(by_rpi_course, out_json, sort_keys=True, indent=2) + if __name__ == "__main__": exit(main()) diff --git a/transfer_scraper/scrape_page.py b/transfer_scraper/scrape_page.py index b1dd551..497b50b 100644 --- a/transfer_scraper/scrape_page.py +++ b/transfer_scraper/scrape_page.py @@ -306,7 +306,9 @@ def main(): print(f"Using randomized user agent {user_agent}", file=sys.stderr) with open(OUT_FILENAME, "w") as transferjson: - json.dump(scrape_page(PAGE_NUM_TO_SCRAPE), transferjson, sort_keys=True, indent=2) + json.dump( + scrape_page(PAGE_NUM_TO_SCRAPE), transferjson, sort_keys=True, indent=2 + ) driver.quit()