diff --git a/.github/workflows/Actions.yaml b/.github/workflows/Actions.yaml new file mode 100644 index 0000000..99065dc --- /dev/null +++ b/.github/workflows/Actions.yaml @@ -0,0 +1,46 @@ + +# name of the workflow. +# this is optional. +name: PyLint + +# events that will trigger this workflow. +# here, we only have "pull_request", so the workflow will run +# whenever we create a pull request. +# other examples: [push] and [pull_request, push] +on: + pull_request: + + push: + branches: + - main + +# each workflow must have at least one job. +# jobs run in parallel by default (we can change that). +# each job groups together a series of steps to accomplish a purpose. +jobs: + # name of the job + ruffLint: + # the platform or OS that the workflow will run on. + runs-on: ubuntu-latest + + # series of steps to finish the job. + steps: + # name of the step. + # steps run sequentially. + # this is optionale + - name: checkout + # each step can either have "uses" or "run". + # "uses" run an action written somewhere other than this workflow . + # usually from the community. + # this action checks out the repo code to the runner (instance) + # running the action + uses: actions/checkout@v3 + + # another step. + # this step runs a bash (Ubuntu's default shell) command + - name: install ruff + run: pip install ruff + + - name: Lint + uses: ruff check ./*/*.py --ignore E402 + diff --git a/ContainerContents/ReadDB.py b/ContainerContents/ReadDB.py index fdb1fc3..214d025 100644 --- a/ContainerContents/ReadDB.py +++ b/ContainerContents/ReadDB.py @@ -3,7 +3,6 @@ import json from filelock import FileLock, Timeout import time -from NoSheet import NoSheet import datetime """ @@ -47,7 +46,7 @@ def ReadDatabase(file_path): # Group the DataFrame by Date, Start Time, and Slot for organization for _, row in df.iterrows(): - date = str(row['Date']) + date = str(row['Date']).split(" ")[0] start_time = str(row['Start Time Slot']) slot = int(row['Slot']) if not pd.isna(row['Slot']) else 0 diff --git a/ContainerContents/interviewPackagers.py b/ContainerContents/interviewPackagers.py index f036977..a2bb7df 100644 --- a/ContainerContents/interviewPackagers.py +++ b/ContainerContents/interviewPackagers.py @@ -35,15 +35,7 @@ def SelectAppointment (file_name, appointmentJson): ``Contact``: darkicewolf50@gmail.com """ - """ - Example of an incoming http post body - { - "intervieweeName": "Brock", - "date": "9/16/2024", - "startTime": "11:00:00", - "intervieweeEmail": "darkicewolf50@gmail.com" - } - """ + try: validEmail = validate_email(appointmentJson["intervieweeEmail"], check_deliverability=True) if validEmail: @@ -58,5 +50,6 @@ def SelectAppointment (file_name, appointmentJson): return resBody except EmailNotValidError as e: + print(e) return {"Success": False, "validEmail": "false"} diff --git a/Other Items/testcontainer.py b/Other Items/testcontainer.py new file mode 100644 index 0000000..150a54e --- /dev/null +++ b/Other Items/testcontainer.py @@ -0,0 +1,17 @@ +import requests +import json + +if __name__ == "__main__": + getres = requests.get("http://bajacloud.ddnsking.com:43443/getAppointments") + print(getres) + print(json.dumps(json.loads(getres.text), indent=4)) + # example of a request + # postdata = { + # "intervieweeName": "Brock", + # "date": "2024-09-16", + # "startTime": "11:00:00", + # "intervieweeEmail": "darkicewolf50@gmail.com" + # } + # res = requests.post("http://bajacloud.ddnsking.com:43443/SelectInterview", json.dumps(postdata)) + # print(res) + # print(res.text) \ No newline at end of file diff --git a/composetest/app.py b/composetest/app.py index 69e5c83..7383f11 100644 --- a/composetest/app.py +++ b/composetest/app.py @@ -1,4 +1,3 @@ -import time from http.server import BaseHTTPRequestHandler, HTTPServer hit_count = 0 # In-memory counter