def _destroy_callback(window): open_windows.remove(window) if len(open_windows) == 0: gtk.main_quit() try: from zenmapCore.UmitDB import UmitDB except ImportError as e: log.debug(">>> Not cleaning up database: %s." % str(e)) else: # Cleaning up data base UmitDB().cleanup(SearchConfig().converted_save_time)
def __init__(self): SearchResult.__init__(self) log.debug(">>> Getting scan results stored in data base") self.scan_results = [] from zenmapCore.UmitDB import UmitDB u = UmitDB() for scan in u.get_scans(): log.debug(">>> Retrieving result of scans_id %s" % scan.scans_id) log.debug(">>> Nmap xml output: %s" % scan.nmap_xml_output) try: buffer = StringIO.StringIO(scan.nmap_xml_output) parsed = NmapParser() parsed.parse(buffer) buffer.close() except Exception, e: log.warning(">>> Error loading scan with ID %u from database: %s" % (scan.scans_id, str(e))) else: self.scan_results.append(parsed)
# A global list of open scan windows. When the last one is destroyed, we call # gtk.main_quit. open_windows = [] def _destroy_callback(window): open_windows.remove(window) if len(open_windows) == 0: gtk.main_quit() try: from zenmapCore.UmitDB import UmitDB except ImportError, e: log.debug(">>> Not cleaning up database: %s." % str(e)) else: # Cleaning up data base UmitDB().cleanup(SearchConfig().converted_save_time) def new_window(): from zenmapGUI.MainWindow import ScanWindow w = ScanWindow() w.connect("destroy", _destroy_callback) if is_maemo(): import hildon hildon_app = hildon.Program() hildon_app.add_window(w) open_windows.append(w) return w # Script found at
def _destroy_callback(window): open_windows.remove(window) if len(open_windows) == 0: gtk.main_quit() # Cleaning up data base UmitDB().cleanup(SearchConfig().converted_save_time)