diff --git a/.github/workflows/cli-ci-test.yaml b/.github/workflows/cli-ci-test.yaml index 746f923..b9aaed3 100644 --- a/.github/workflows/cli-ci-test.yaml +++ b/.github/workflows/cli-ci-test.yaml @@ -2,27 +2,26 @@ name: Integration Test for CLI workflow on: workflow_dispatch: - # pull_request: - # types: - # - opened - # - synchronize - # branches: - # - master - # paths-ignore: - # - "**.md" - # - "**.yaml" - # - "LICENSE" - # - "frontend/**" - # - ".github/workflows/frontend-ci-test.yaml" - # - ".github/workflows/deploy-gh-pages.yaml" - # - ".github/workflows/deploy-gyft-do.yaml" - # - "metaploy/**" - # - ".gitignore" - # - "app.py" - # - "wsgi.py" - # - ".dockerignore" - # - "Dofkerfile" - # - "Dofkerfile-dev" + pull_request: + types: + - opened + - synchronize + branches: + - master + paths-ignore: + - "**.md" + - "LICENSE" + - "frontend/**" + - ".github/workflows/frontend-ci-test.yaml" + - ".github/workflows/deploy-gh-pages.yaml" + - ".github/workflows/deploy-gyft-do.yaml" + - "metaploy/**" + - ".gitignore" + - "app.py" + - "wsgi.py" + - ".dockerignore" + - "Dofkerfile" + - "Dofkerfile-dev" jobs: cli-ci: @@ -53,4 +52,4 @@ jobs: echo "$CREDENTIALS_JSON" > credentials.json - name: Run the project - run: python gyft.py -D + run: python gyft.py -DO diff --git a/utils/dates.py b/utils/dates.py index 12e4d23..e29df7a 100644 --- a/utils/dates.py +++ b/utils/dates.py @@ -31,8 +31,12 @@ def get_holidates() -> (list[datetime], list[str, datetime]): scrapes holiday list from IITKGP website returns: list of holidays as occasions and datetime objects """ + headers = { + "timeout": "20", + "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/51.0.2704.79 Chrome/51.0.2704.79 Safari/537.36", + } url = "https://www.iitkgp.ac.in/holidays" - result = requests.get(url).text + result = requests.get(url=url, headers=headers).text doc = bs(result, "html.parser") tbody = doc.tbody trs = tbody.contents @@ -182,4 +186,4 @@ def get_rfc_time(time: int, day: str, minute: int = 0, second: int = 0) -> str: for hday in hdays.keys(): hdays[hday].sort() - hdays[hday] = list(set(hdays[hday])) ### datetime dict(list) \ No newline at end of file + hdays[hday] = list(set(hdays[hday])) ### datetime dict(list)