Beispiel #1
0
 def onImport(self, evt):
     try:
         assets = self.dbProxy.getDimensions('asset')
         if (len(assets) == 0):
             dlg = wx.MessageDialog(
                 self,
                 'Cannot import a vulnerability as no assets have been defined',
                 'Add vulnerability', wx.OK)
             dlg.ShowModal()
             dlg.Destroy()
             return
         dirDlg = DirectoryDialog(self, 'vulnerability')
         if (dirDlg.ShowModal() == armid.DIRECTORYDIALOG_BUTTONIMPORT_ID):
             objt = dirDlg.object()
             importParameters = DialogClassParameters(
                 armid.VULNERABILITY_ID, 'Import vulnerability',
                 VulnerabilityDialog.VulnerabilityDialog,
                 armid.VULNERABILITY_BUTTONCOMMIT_ID,
                 self.dbProxy.addVulnerability, False)
             self.importObject(objt, importParameters)
     except ARM.ARMException, errorText:
         dlg = wx.MessageDialog(self, str(errorText),
                                'Import vulnerability',
                                wx.OK | wx.ICON_ERROR)
         dlg.ShowModal()
         dlg.Destroy()
         return
 def onImport(self,evt):
   try:
     assets = self.dbProxy.getDimensions('asset')
     if (len(assets) == 0):
       dlg = wx.MessageDialog(self,'Cannot import a vulnerability as no assets have been defined','Add vulnerability',wx.OK)
       dlg.ShowModal()
       dlg.Destroy()
       return
     dirDlg = DirectoryDialog(self,'vulnerability')
     if (dirDlg.ShowModal() == DIRECTORYDIALOG_BUTTONIMPORT_ID):
       objt = dirDlg.object()
       importParameters = DialogClassParameters(VULNERABILITY_ID,'Import vulnerability',VulnerabilityDialog.VulnerabilityDialog,VULNERABILITY_BUTTONCOMMIT_ID,self.dbProxy.addVulnerability,False)
       self.importObject(objt,importParameters)
   except ARMException,errorText:
     dlg = wx.MessageDialog(self,str(errorText),'Import vulnerability',wx.OK | wx.ICON_ERROR)
     dlg.ShowModal()
     dlg.Destroy()
     return
Beispiel #3
0
 def onImport(self,evt):
   try:
     assets = self.dbProxy.getDimensions('asset')
     if (len(assets) == 0):
       dlg = wx.MessageDialog(self,'Cannot import a threat as no assets have been defined','Add threat',wx.OK)
       dlg.ShowModal()
       dlg.Destroy()
       return
     dirDlg = DirectoryDialog(self,'threat')
     if (dirDlg.ShowModal() == DIRECTORYDIALOG_BUTTONIMPORT_ID):
       objt = dirDlg.object()
       importParameters = DialogClassParameters(THREAT_ID,'Import threat',ThreatDialog,THREAT_BUTTONCOMMIT_ID,self.dbProxy.addThreat,False)
       self.importObject(objt,importParameters)
   except ARMException,errorText:
     dlg = wx.MessageDialog(self,str(errorText),'Import threat',wx.OK | wx.ICON_ERROR)
     dlg.ShowModal()
     dlg.Destroy()
     return
Beispiel #4
0
 def onImport(self, evt):
     try:
         assets = self.dbProxy.getDimensions('asset')
         if (len(assets) == 0):
             dlg = wx.MessageDialog(
                 self,
                 'Cannot import a threat as no assets have been defined',
                 'Add threat', wx.OK)
             dlg.ShowModal()
             dlg.Destroy()
             return
         dirDlg = DirectoryDialog(self, 'threat')
         if (dirDlg.ShowModal() == DIRECTORYDIALOG_BUTTONIMPORT_ID):
             objt = dirDlg.object()
             importParameters = DialogClassParameters(
                 THREAT_ID, 'Import threat', ThreatDialog,
                 THREAT_BUTTONCOMMIT_ID, self.dbProxy.addThreat, False)
             self.importObject(objt, importParameters)
     except ARMException, errorText:
         dlg = wx.MessageDialog(self, str(errorText), 'Import threat',
                                wx.OK | wx.ICON_ERROR)
         dlg.ShowModal()
         dlg.Destroy()
         return