diff --git a/mdh.py b/mdh.py index 3d842a8..547f2ad 100644 --- a/mdh.py +++ b/mdh.py @@ -1,14 +1,14 @@ from playwright.sync_api import Playwright, sync_playwright, expect from time import sleep -from secrets import PASSWORD, EMAIL, LOCATION +from secrets import PASSWORD, EMAIL, LOCATION, DEBUG def start_shift(playwright: Playwright, end_hour: str, end_minute: str) -> None: before_noon = int(end_hour) < 12 if int(end_hour) > 12: end_hour = str(int(end_hour) - 12) - browser = playwright.chromium.launch(headless=False) + browser = playwright.chromium.launch(headless=DEBUG) context = browser.new_context() page = context.new_page() page.goto("https://beta.mydigitalhand.org/") @@ -56,7 +56,7 @@ def start_shift(playwright: Playwright, end_hour: str, end_minute: str) -> None: browser.close() def end_shift(playwright: Playwright) -> None: - browser = playwright.chromium.launch(headless=False) + browser = playwright.chromium.launch(headless=DEBUG) context = browser.new_context() page = context.new_page() page.goto("https://beta.mydigitalhand.org/") @@ -102,4 +102,4 @@ if __name__ == "__main__": end_minutes = int(end_hour) * 60 + int(end_minute) if day == now.weekday() and start_minutes <= now.hour * 60 + now.minute <= end_minutes: - start_shift(playwright, end_hour, end_minute) \ No newline at end of file + start_shift(playwright, end_hour, end_minute) diff --git a/secrets.sample b/secrets.sample index 9c8d03b..0114c84 100644 --- a/secrets.sample +++ b/secrets.sample @@ -1,3 +1,4 @@ EMAIL= PASSWORD= -LOCATION= \ No newline at end of file +LOCATION= +DEBUG=True