* Added setup_log_location function to handle log directory creation and validation. * Updated setup_logging function to accept a log location instead of a log file name. * Updated parse_args function to handle log directory argument and validate the presence of a config file. * Updated read_file function to raise an error if the specified file does not exist. * Updated parse_toml function to raise an error if the parsed TOML content is None. * Added get_calendar_dir function to validate the existence of the calendar directory. * Added parse_calendar_files function to find and return a list of .ics files in the specified directory. * Added construct_initial_event_dict function to parse each .ics file into an event dictionary and store them in a list. * Updated FileChangeHandler class to log warnings instead of errors for invalid or unparseable files. * Updated CalendarParser class to log warnings if no event dates are found for an event, or if the calendar component is missing. * Added daemon function to monitor events and update status files at regular intervals. * Updated main function to use setup_log_location, parse_args, get_calendar_dir, and construct_initial_event_dict functions.
21 lines
779 B
Makefile
21 lines
779 B
Makefile
install:
|
|
sudo apt-get update && sudo apt install python3-venv -y
|
|
sudo mkdir -p /opt/remindme_caldav/status /etc/remindme_caldav
|
|
python3 -m venv /opt/remindme_caldav/.venv
|
|
cp remindme_caldav.py alert_processor.py /opt/remindme_caldav/
|
|
. /opt/remindme_caldav/.venv/bin/activate && pip3 install -r requirements.txt
|
|
sudo cp remindme_caldav.service /etc/systemd/system/
|
|
sudo cp config.toml /etc/remindme_caldav/config.toml
|
|
sudo systemctl daemon-reload
|
|
sudo systemctl enable remindme_caldav.service
|
|
sudo systemctl start remindme_caldav.service
|
|
|
|
uninstall:
|
|
sudo systemctl stop remindme_caldav.service
|
|
sudo systemctl disable remindme_caldav.service
|
|
rm -rf /opt/remindme_caldav
|
|
rm -rf /etc/remindme_caldav
|
|
rm /etc/systemd/system/remindme_caldav.service
|
|
|
|
clean:
|
|
deactivate
|