-
Notifications
You must be signed in to change notification settings - Fork 1
/
report_artifacts.py
50 lines (34 loc) · 1.31 KB
/
report_artifacts.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
'''
Copyright 2021 Flexera Software LLC
See LICENSE.TXT for full license text
SPDX-License-Identifier: MIT
Author : sgeary
Created On : Thu Dec 16 2021
File : report_artifacts.py
'''
import logging
import report_artifacts_html
import report_artifacts_text
import report_artifacts_error
logger = logging.getLogger(__name__)
#--------------------------------------------------------------------------------#
def create_report_artifacts(reportData):
logger.info("Entering create_report_artifacts")
# Dict to hold the complete list of reports
reports = {}
htmlFile = report_artifacts_html.generate_html_report(reportData)
textFile = report_artifacts_text.generate_text_report(reportData)
reports["viewable"] = htmlFile
reports["allFormats"] = [htmlFile, textFile]
logger.info("Exiting create_report_artifacts")
return reports
#--------------------------------------------------------------------------------#
def create_error_artifacts(reportData):
logger.info("Entering create_error_report")
# Dict to hold the complete list of reports
reports = {}
htmlFile = report_artifacts_error.generate_error_report(reportData)
reports["viewable"] = htmlFile
reports["allFormats"] = [htmlFile]
logger.info("Exiting create_report_artifacts")
return reports