diff options
-rw-r--r-- | config.example.ini | 15 | ||||
-rw-r--r-- | cycles.json | 177 | ||||
-rwxr-xr-x | daily.py | 6 | ||||
-rw-r--r-- | sjdbmk/weekly.py | 4 |
4 files changed, 8 insertions, 194 deletions
diff --git a/config.example.ini b/config.example.ini index f1d9071..6f2d1d2 100644 --- a/config.example.ini +++ b/config.example.ini @@ -10,9 +10,6 @@ sender = Patrick.LI@sodexo.com query_string = YKPao-SJ weekly menu subject_regex = YKPao-SJ weekly menu \((.+?) ([0-9]?[0-9])(st|nd|rd|th)? ?- ?(.+?) ([0-9]?[0-9])(st|nd|rd|th)?\) subject_regex_four_groups = 1 2 4 5 -breakfast_page_number = 0 -lunch_page_number = 1 -dinner_page_number = 2 [credentials] username = s22537@ykpaoschool.cn @@ -24,10 +21,8 @@ scope = Calendars.Read.Shared Mail.ReadWrite Mail.Send User.Read Files.Read.All [general] timezone = Asia/Shanghai -# ./build is used by pyinstaller -build_path = ../build +build_path = /srv/sjdb/build cycle_data = cycles.json -soffice = soffice [templates] directory = templates/ @@ -45,10 +40,10 @@ address = sj-calendar@ykpaoschool.cn subject_format = Daily Bulletin %%s subject_date_format = %%Y-%%m-%%d to_1 = s22537@stu.ykpaoschool.cn -cc_1 = cora.chen@ykpaoschool.cn -bcc_1_file = l1.txt +cc_1 = +bcc_1_file = rcpt1.txt to_2 = s22537@stu.ykpaoschool.cn -cc_2 = duncan.weller@ykpaoschool.cn -bcc_2_file = l2.txt +cc_2 = +bcc_2_file = rcpt2.txt hour = 6 minute = 00 diff --git a/cycles.json b/cycles.json deleted file mode 100644 index 59c9e64..0000000 --- a/cycles.json +++ /dev/null @@ -1,177 +0,0 @@ -{
- "comment": "This should be replaced by the Outlook Shared Calendar interpretation script later, but should suffice for now.",
- "2023-09-04": "A",
- "2023-09-05": "B",
- "2023-09-06": "C",
- "2023-09-07": "D",
- "2023-09-08": "E",
- "2023-09-11": "F",
- "2023-09-12": "A",
- "2023-09-13": "B",
- "2023-09-14": "C",
- "2023-09-15": "D",
- "2023-09-18": "E",
- "2023-09-19": "F",
- "2023-09-20": "A",
- "2023-09-21": "B",
- "2023-09-22": "C",
- "2023-09-25": "D",
- "2023-09-26": "E",
- "2023-09-27": "F",
- "2023-09-28": "A",
- "2023-10-09": "B",
- "2023-10-10": "C",
- "2023-10-11": "D",
- "2023-10-12": "E",
- "2023-10-13": "F",
- "2023-10-16": "A",
- "2023-10-17": "B",
- "2023-10-18": "C",
- "2023-10-19": "D",
- "2023-10-20": "E",
- "2023-10-23": "F",
- "2023-10-24": "A",
- "2023-10-25": "B",
- "2023-10-26": "C",
- "2023-10-30": "D",
- "2023-10-31": "E",
- "2023-11-01": "F",
- "2023-11-02": "A",
- "2023-11-03": "B",
- "2023-11-06": "C",
- "2023-11-07": "D",
- "2023-11-08": "E",
- "2023-11-09": "F",
- "2023-11-10": "A",
- "2023-11-13": "B",
- "2023-11-14": "C",
- "2023-11-15": "D",
- "2023-11-20": "E",
- "2023-11-21": "F",
- "2023-11-22": "A",
- "2023-11-23": "B",
- "2023-11-24": "C",
- "2023-11-27": "D",
- "2023-11-28": "E",
- "2023-11-29": "F",
- "2023-11-30": "A",
- "2023-12-04": "B",
- "2023-12-05": "C",
- "2023-12-06": "D",
- "2023-12-07": "E",
- "2023-12-08": "F",
- "2023-12-11": "A",
- "2023-12-12": "B",
- "2023-12-13": "C",
- "2023-12-14": "D",
- "2023-12-15": "E",
- "2023-12-18": "F",
- "2023-12-19": "A",
- "2023-12-20": "B",
- "2023-12-21": "C",
- "2024-01-08": "D",
- "2024-01-09": "E",
- "2024-01-10": "F",
- "2024-01-11": "A",
- "2024-01-12": "B",
- "2024-01-15": "C",
- "2024-01-16": "D",
- "2024-01-17": "E",
- "2024-01-18": "F",
- "2024-01-19": "A",
- "2024-01-22": "B",
- "2024-01-23": "C",
- "2024-01-24": "D",
- "2024-01-25": "E",
- "2024-01-26": "F",
- "2024-01-29": "A",
- "2024-01-30": "B",
- "2024-01-31": "C",
- "2024-02-01": "D",
- "2024-02-19": "E",
- "2024-02-20": "F",
- "2024-02-21": "A",
- "2024-02-22": "B",
- "2024-02-23": "C",
- "2024-02-26": "D",
- "2024-02-27": "E",
- "2024-02-28": "F",
- "2024-02-29": "A",
- "2024-03-01": "B",
- "2024-03-04": "C",
- "2024-03-05": "D",
- "2024-03-06": "E",
- "2024-03-07": "F",
- "2024-03-08": "A",
- "2024-03-11": "B",
- "2024-03-12": "C",
- "2024-03-13": "D",
- "2024-03-14": "E",
- "2024-03-15": "F",
- "2024-03-18": "A",
- "2024-03-19": "B",
- "2024-03-20": "C",
- "2024-03-21": "D",
- "2024-03-22": "E",
- "2024-03-25": "F",
- "2024-03-26": "A",
- "2024-03-27": "B",
- "2024-03-28": "C",
- "2024-03-29": "D",
- "2024-04-09": "E",
- "2024-04-10": "F",
- "2024-04-11": "A",
- "2024-04-12": "B",
- "2024-04-15": "C",
- "2024-04-16": "D",
- "2024-04-17": "E",
- "2024-04-18": "F",
- "2024-04-19": "A",
- "2024-04-22": "B",
- "2024-04-23": "C",
- "2024-04-24": "D",
- "2024-04-25": "E",
- "2024-04-26": "F",
- "2024-04-29": "A",
- "2024-04-30": "B",
- "2024-05-02": "C",
- "2024-05-03": "D",
- "2024-05-06": "E",
- "2024-05-07": "F",
- "2024-05-08": "A",
- "2024-05-09": "B",
- "2024-05-10": "C",
- "2024-05-13": "D",
- "2024-05-14": "E",
- "2024-05-15": "F",
- "2024-05-16": "A",
- "2024-05-17": "B",
- "2024-05-20": "C",
- "2024-05-21": "D",
- "2024-05-22": "E",
- "2024-05-23": "F",
- "2024-05-24": "A",
- "2024-05-27": "B",
- "2024-05-28": "C",
- "2024-05-29": "D",
- "2024-05-30": "E",
- "2024-05-31": "F",
- "2024-06-03": "A",
- "2024-06-04": "B",
- "2024-06-05": "C",
- "2024-06-06": "D",
- "2024-06-07": "E",
- "2024-06-11": "F",
- "2024-06-12": "A",
- "2024-06-13": "B",
- "2024-06-14": "C",
- "2024-06-17": "D",
- "2024-06-18": "E",
- "2024-06-19": "F",
- "2024-06-20": "A",
- "2024-06-21": "B",
- "2024-06-24": "C",
- "2024-06-25": "D",
- "2024-06-26": "E",
- "2024-06-27": "F"
-}
@@ -79,13 +79,13 @@ def main() -> None: del datetime_target_naive logger.info("Generating for %s" % datetime_target_aware.strftime("%Y-%m-%d %Z")) + build_path = config["general"]["build_path"] + os.chdir(build_path) + cycle_data_path = config["general"]["cycle_data"] with open(cycle_data_path, "r", encoding="utf-8") as cycle_data_file: cycle_data = json.load(cycle_data_file) - build_path = config["general"]["build_path"] - os.chdir(build_path) - the_week_ahead_url = config["the_week_ahead"]["file_url"] generate( diff --git a/sjdbmk/weekly.py b/sjdbmk/weekly.py index ea6d47a..3006582 100644 --- a/sjdbmk/weekly.py +++ b/sjdbmk/weekly.py @@ -66,7 +66,6 @@ def generate( graph_password: str, graph_scopes: list[str], calendar_address: str, - soffice: str, ) -> str: if not datetime_target.tzinfo: raise TypeError("Naive datetimes are unsupported") @@ -143,8 +142,6 @@ def main() -> None: calendar_address = config["calendar"]["address"] - soffice = config["general"]["soffice"] - # TODO: Validate the configuration generate( @@ -162,7 +159,6 @@ def main() -> None: graph_password=graph_password, graph_scopes=graph_scopes, calendar_address=calendar_address, - soffice=soffice, ) |