diff --git a/PentestMapper.py b/PentestMapper.py index 5177e99..84ff73a 100644 --- a/PentestMapper.py +++ b/PentestMapper.py @@ -343,11 +343,11 @@ def deleterow(self,event): row = self.logTable.getSelectedRows() for rows in row: - logEntry = self._log[rows] + #logEntry = self._log[rows] self._log.pop(rows) self.fireTableDataChanged() - totalrow = self.logTable.getRowCount() - self.callbacks.printOutput(str(totalrow)) + #totalrow = self.logTable.getRowCount() + #self.callbacks.printOutput(str(totalrow)) @@ -488,17 +488,25 @@ def getUiComponent(self): def savelogger(self,e): currenttime = str(time.strftime('%Y-%m-%d,%H:%M:%S', time.localtime(time.time()))) chooseFile = swing.JFileChooser() + chooseFile.setFileSelectionMode(swing.JFileChooser.DIRECTORIES_ONLY) + returnedFile = chooseFile.showDialog(self.buttonPanel2, "Output Path") + + ''' filter = FileNameExtensionFilter("csv files", ["csv"]) chooseFile.addChoosableFileFilter(filter) returnedFile = chooseFile.showDialog(self.buttonPanel2, "Choose File") + ''' if returnedFile == JFileChooser.APPROVE_OPTION: fileLoad = chooseFile.getSelectedFile() - self.filepath = fileLoad.getAbsolutePath() + #self.filepath = fileLoad.getAbsolutePath() + self.filepath = fileLoad.getPath() + fname = "APIMapper"+str(time.time())+"."+"csv" + fnameWithPath = os.path.join(self.filepath,fname) - with open(self.filepath, 'wb') as loggerdata: + with open(fnameWithPath, 'wb') as loggerdata: writer = csv.writer(loggerdata) for logEntry in self._log: @@ -606,14 +614,21 @@ def exportvulnerability(self,e): self.callbacks.printOutput(str(totalrow)) chooseFile = swing.JFileChooser() - filter = FileNameExtensionFilter("csv files", ["csv"]) - chooseFile.addChoosableFileFilter(filter) - returnedFile = chooseFile.showDialog(self.buttonPanel4, "Choose File") + + chooseFile.setFileSelectionMode(swing.JFileChooser.DIRECTORIES_ONLY) + returnedFile = chooseFile.showDialog(self.buttonPanel4, "Output Path") + #filter = FileNameExtensionFilter("csv files", ["csv"]) + #chooseFile.addChoosableFileFilter(filter) + #returnedFile = chooseFile.showDialog(self.buttonPanel4, "Choose File") if returnedFile == JFileChooser.APPROVE_OPTION: fileLoad1 = chooseFile.getSelectedFile() - self.filepath2 = fileLoad1.getAbsolutePath() - with open(self.filepath2, 'wb') as vulnerabilitydata: + self.filepath2 = fileLoad1.getPath() + fname2 = "Vulnerability"+str(time.time())+"."+"csv" + fnameWithPath = os.path.join(self.filepath2,fname2) + + #self.filepath2 = fileLoad1.getAbsolutePath() + with open(fnameWithPath, 'wb') as vulnerabilitydata: writer = csv.writer(vulnerabilitydata) for row in range (0, totalrow): url = self.dataModel2.getValueAt(row,0)