explode.append(0.02) colors.append(c[i]) plot.pie(data, colors = colors, explode = explode, labels = labels, autopct = None); plot.title('Vulnerabilities', bbox = {'facecolor': '0.9', 'pad': 15}) img_file = '/'.join([SCAN_HOME, fibasic.scan_id]) 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()
explode.append(0.02) colors.append(c[i]) plot.pie(data, colors = colors, explode = explode, labels = labels, autopct = None); plot.title('Vulnerabilities', bbox = {'facecolor': '0.9', 'pad': 15}) img_file = SCAN_HOME + '/%s.png' % (queue.scan_id) 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()