Skip to content

Commit

Permalink
with proper html tags and title
Browse files Browse the repository at this point in the history
  • Loading branch information
boberito authored Sep 14, 2022
1 parent 6baacf0 commit fef3c91
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions mscp_local_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# description: Point to mSCP Plist Log File to make pretty graph,
# required: input file and output file
# ./mscp_local_report -p /Library/Preferences/org.BASELINE.audit.plist -o ~/prettyoutput.xlsx

import argparse
from openpyxl import Workbook
from pathlib import Path
Expand Down Expand Up @@ -94,7 +95,19 @@ def validate_file(arg):

temp_dir.cleanup()

html = '<img src="data:image/png;base64,{}"><br>0 = Passed<br>1 = Finding'.format(pngimg)
html = '''<!DOCTYPE html>
<html>
<head>
<title>mSCP Compliance Scan Results</title>
</head>
<body>
<img src="data:image/png;base64,{}">
<br>0 = Passed
<br>1 = Finding
'''.format(pngimg)

endhtml = '''
</body>
</html>'''
with open(htmlsavefile, 'r') as original: data = original.read()
with open(htmlsavefile, 'w') as modified: modified.write(html + data)
with open(htmlsavefile, 'w') as modified: modified.write(html + data + endhtml)

0 comments on commit fef3c91

Please sign in to comment.