예제 #1
0
plot.savefig(img_file)

# ---------------------------------------------------------
# HTML Webpage
TMPL_FILE = '/'.join([SCAN_HOME, 'fibasic-results.tmpl'])
html = Template(file=TMPL_FILE)

html.no_results = False
if len(high) == 0 and len(medium) == 0 and len(low) == 0:
    html.no_results = True
else:
    html.img = '.'.join([str(fibasic.scan_id), 'png'])

html.host = fibasic.hostname
html.high = high
html.medium = medium
html.low = low


page_file = '%s.html' % fibasic.scan_id
fd = open('/'.join([SCAN_HOME, page_file]), 'w')
fd.write(html.respond())
fd.close()

# ---------------------------------------------------------
# CSV file (for spreadsheet)
csv_file = '%s.txt' % fibasic.scan_id
fd = open('/'.join([TMPDIR, csv_file]), 'w')

if len(high) > 0:
    for h in high:
예제 #2
0
plot.savefig(img_file)

# ---------------------------------------------------------
# HTML Webpage
TMPL_FILE = '/'.join([SCAN_HOME, 'forxf.html'])
html = Template(file=TMPL_FILE)

html.no_results = False
if len(high) == 0 and len(medium) == 0 and len(low) == 0:
    html.no_results = True
else:
    html.img = '.'.join([str(queue.scan_id), 'png'])

html.host = queue.hostname
html.high = high
html.medium = medium
html.low = low


page_file = '%s.html' % queue.scan_id
fd = open('/'.join([SCAN_HOME, page_file]), 'w')
fd.write(html.respond())
fd.close()



# PDF
PDF_TMPL = '/'.join([SCAN_HOME, 'forxf-pdf.html'])
pdf_html = Template(file=PDF_TMPL)
pdf_html.no_results = False
if len(high) == 0 and len(medium) == 0 and len(low) == 0: