|
@@ -149,6 +149,21 @@ class c11_export:
|
|
|
params.update(optional_params)
|
|
|
return params
|
|
|
|
|
|
+ def filter_request_plan(req_plan: list[list[ReportRequest]], mail_csv: str):
|
|
|
+ if not Path(mail_csv).exists():
|
|
|
+ return req_plan
|
|
|
+ required_files = []
|
|
|
+ with open(Path(mail_csv), "r", encoding="latin-1") as rfh:
|
|
|
+ for row in rfh.readlines():
|
|
|
+ filename, mailto = row.removesuffix("\r\n").split(";")
|
|
|
+ if mailto == "":
|
|
|
+ continue
|
|
|
+ required_files.append(filename)
|
|
|
+ res = []
|
|
|
+ for req_group in required_files:
|
|
|
+ res.append([req for req in req_group if req.filename in required_files])
|
|
|
+ return res
|
|
|
+
|
|
|
def execute_request_plan(self, req_plan: list[list[ReportRequest]]):
|
|
|
for req_group in req_plan:
|
|
|
for report_req in req_group:
|