def Start_scan(self): self.StatusMonitor(True, 'stas_scan') threadscan_check = self.configure.xmlSettings('advanced', 'Function_scan', None, False) self.tables.clear() self.data = {'IPaddress': [], 'Hostname': [], 'MacAddress': []} if threadscan_check == 'Nmap': try: from nmap import PortScanner except ImportError: QMessageBox.information( self, 'Error Nmap', 'The modules python-nmap not installed') return if self.txt_gateway.text() != '': self.movie_screen.setDisabled(True) self.tables.setVisible(False) config_gateway = str(self.txt_gateway.text()) scan = '' config_gateway = config_gateway.split('.') del config_gateway[-1] for i in config_gateway: scan += str(i) + '.' self.ThreadScanner = ThreadScan(scan + '0/24') self.connect(self.ThreadScanner, SIGNAL('Activated ( QString ) '), self.thread_scan_reveice) self.StatusMonitor(True, 'stas_scan') self.ThreadScanner.start() else: QMessageBox.information(self, 'Error in gateway', 'gateway not found.') elif threadscan_check == 'Ping': if self.txt_gateway.text() != '': config = str(self.txt_gateway.text()) t = threading.Thread(target=self.scanner_network, args=(config, )) t.daemon = True t.start(), t.join() self.StatusMonitor(False, 'stas_scan') else: QMessageBox.information(self, 'Error in gateway', 'gateway not found.') else: QMessageBox.information(self, 'Error on select thread Scan', 'thread scan not selected.')