chore: updated gitignore and work

This commit is contained in:
Rushil Umaretiya 2024-02-01 12:52:27 -05:00
parent 9a4804ecd0
commit c60c457b3e
No known key found for this signature in database
GPG Key ID: 4E8FAF9C926AF959
2 changed files with 6 additions and 5 deletions

8
mdh.py
View File

@ -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)
start_shift(playwright, end_hour, end_minute)

View File

@ -1,3 +1,4 @@
EMAIL=
PASSWORD=
LOCATION=
LOCATION=
DEBUG=True