1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-07 13:11:28 +00:00

Deduplicate scan names in the diff window.

This is based on an idea from jah in
http://seclists.org/nmap-dev/2012/q1/655. Make ScanChooser and
DiffWindow take a flat list of scans, not a dict of names → scans, and
centralize the deduplication in ScanChooser.add_scan.
This commit is contained in:
david
2012-03-30 06:54:17 +00:00
parent b2f3139284
commit ce11ecb708
3 changed files with 18 additions and 35 deletions

View File

@@ -840,22 +840,7 @@ running at the background.\nWhat do you want to do?'))
def _load_diff_compare_cb (self, widget=None, extra=None):
"""Loads all active scans into a dictionary, passes it to the DiffWindow
constructor, and then displays the 'Compare Results' window."""
# We must change this test dict
# This dict has the following syntax:
# key = Scan name
# value = nmap output in string format
dic = {}
for parsed in self.scan_interface.inventory.get_scans():
if parsed.scan_name:
scan_name = parsed.scan_name
else:
scan_name = parsed.get_nmap_command()
dic[scan_name] = parsed
self.diff_window = DiffWindow(dic)
self.diff_window = DiffWindow(self.scan_interface.inventory.get_scans())
self.diff_window.show_all()
def show_help():