class Conclusion(QWidget): def __init__(self): super().__init__() self.title = 'VAPT Tool' self.left = 10 self.top = 10 self.width = 1280 self.height = 720 self.doc = Print_document() self.doc = Print_document() if self.doc.start_doc(): self.doc.reinitialize_doc() else: self.doc.start_doc() self.doc.initialize_doc() def ConclusionUI(self): self.setWindowTitle(self.title) self.setGeometry(self.left, self.top, self.width, self.height) self.font = QFont() self.font.setFamily('Helvetica') self.font.setPointSize(16) self.Conc = QLabel('Conclusion:', self) self.Conc.move(120, 105) self.Conc.resize(250, 50) self.Conc.setFont(self.font) self.ConcBox = QPlainTextEdit(self) self.ConcBox.move(240, 80) self.ConcBox.resize(600, 300) self.button = QPushButton('Save', self) self.button.move(100, 300) self.button.resize(100, 50) self.button.clicked.connect(self.on_click) self.Back_button = QPushButton('Back', self) self.Back_button.move(100, 400) self.Back_button.resize(100, 50) self.Back_button.clicked.connect(self.back) self.show() @pyqtSlot() def on_click(self): conclusion = self.ConcBox.toPlainText() self.doc.setConclusion(conclusion) name = QFileDialog.getSaveFileName(self, 'Save File', '/') self.doc.Savedoc(name) os.remove('Temp.docx') @pyqtSlot() def back(self): self.ui = MainWindow.App1() self.ui.initUI() Conclusion.hide(self)
class App(QWidget): def __init__(self): super().__init__() self.title = 'VAPT Report Generator' self.left = 10 self.top = 10 self.width = 1280 self.height = 720 self.__Img = None self.doc = Print_document() self.doc.start_doc() self.doc.initialize_doc() self.initUI() def initUI(self): self.setWindowTitle(self.title) self.setWindowIcon(QIcon("")) self.setGeometry(self.left, self.top, self.width, self.height) self.Vname = QLabel('Vulnerabilty Name:',self) self.Vname.move(20, 5) self.Vname.resize(250,50) self.Vnamebox = QLineEdit(self) self.Vnamebox.move(260, 10) self.Vnamebox.resize(600,30) self.VDesc = QLabel('Vulnerabilty Description:',self) self.VDesc.move(20, 80) self.VDesc.resize(250,50) self.VDescbox = QPlainTextEdit(self) self.VDescbox.move(260, 50) self.VDescbox.resize(600,100) self.Vurl = QLabel('Vulnearable URL:',self) self.Vurl.move(20, 155) self.Vurl.resize(250,50) self.Vurlbox = QLineEdit(self) self.Vurlbox.move(260, 160) self.Vurlbox.resize(600,30) self.VSeverity = QLabel('Severity:',self) self.VSeverity.move(20, 205) self.VSeverity.resize(250,50) self.VSeveritybox = QComboBox(self) self.VSeveritybox.addItem('Critical',1) self.VSeveritybox.addItem('High',2) self.VSeveritybox.addItem('Medium',3) self.VSeveritybox.addItem('Low',4) self.VSeveritybox.addItem('Informational',5) self.VSeveritybox.move(260, 210) self.VSeveritybox.resize(600,30) #self.VSeveritybox.activated.connect(self.handleActivated) self.VImpact = QLabel('Impact:',self) self.VImpact.move(20, 280) self.VImpact.resize(250,80) self.VImpactBox = QPlainTextEdit(self) self.VImpactBox.move(260, 250) self.VImpactBox.resize(600,130) self.VRemediation = QLabel('Remediation:',self) self.VRemediation.move(20, 425) self.VRemediation.resize(250,50) self.VRemediationBox = QPlainTextEdit(self) self.VRemediationBox.move(260, 400) self.VRemediationBox.resize(600,100) self.SaveButton = QPushButton('Save', self) self.SaveButton.move(480,580) self.SaveButton.clicked.connect(self.on_click) self.saveReport = QPushButton('Add Vulnerabilty',self) self.saveReport.move(560,580) self.saveReport.clicked.connect(self.on_report) self.ImgButton = QPushButton('Browse', self) self.ImgButton.move(400,580) self.ImgButton.clicked.connect(self.on_browse) self.show() @pyqtSlot() def on_browse(self): self.__Img = QFileDialog.getOpenFileNames(self,'Open Files','/',("Images(*.png)")) @pyqtSlot() def on_report(self): vname = self.Vnamebox.text() self.doc.setVname(vname) self.Vnamebox.setText("") severity = self.VSeveritybox.currentText() self.doc.setVSeverity(severity) VDesc = self.VDescbox.toPlainText() self.doc.SetVdesc(VDesc) self.VDescbox.setPlainText('') Vurl = self.Vurlbox.text() self.doc.setVurl(Vurl) self.Vurlbox.setText('') self.doc.setImg(self.__Img) VImpact = self.VImpactBox.toPlainText() self.doc.setImpact(VImpact) self.VImpactBox.setPlainText('') Vrem = self.VRemediationBox.toPlainText() self.doc.setVremed(Vrem) self.VRemediationBox.setPlainText('') self.doc.pageBreak() @pyqtSlot() def on_click(self): name = QFileDialog.getSaveFileName(self,'Save File','/') self.doc.Savedoc(name)