-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from albertsgarde/5-support-date-ranges-for-bo…
…oking 5 support date ranges for booking
- Loading branch information
Showing
11 changed files
with
352 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import json | ||
import os | ||
from pathlib import Path | ||
|
||
if __name__ == "__main__": | ||
database_path_option: str | None = os.getenv("DATABASE_PATH") | ||
if database_path_option is None: | ||
raise ValueError("DATABASE_PATH is not set in environment variables") | ||
else: | ||
database_path: Path = Path(database_path_option) | ||
|
||
db_dict = json.loads(database_path.read_text()) | ||
for event in db_dict["history"]: | ||
event_data = event["event"] | ||
if "desk_index" in event_data and "date" in event_data: | ||
event_data["start_date"] = event_data["date"] | ||
event_data["end_date"] = event_data["date"] | ||
del event_data["date"] | ||
database_path.write_text(json.dumps(db_dict)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
#!/bin/bash | ||
# Hack to get repo location. This breaks if the server directory is moved. | ||
# Hack to get repo location. | ||
REPO_PATH=$(dirname $(readlink -f $0)) | ||
cd $REPO_PATH | ||
if [ ! -d ".venv" ]; then | ||
python -m venv .venv | ||
fi | ||
source .venv/bin/activate | ||
python -m pip install -r requirements.txt | ||
python -m pip install uv | ||
uv sync | ||
source .env | ||
python -m eadk_discord | ||
uv run eadk_discord |
Oops, something went wrong.