Example #1
0
 def onSituate(self, evt):
     spObjt = self.theParentDialog.objts[self.theParentDialog.selectedLabel]
     patternId = spObjt.id()
     try:
         dlg = SecurityPatternEnvironmentDialog(self, patternId)
         if (dlg.ShowModal() == armid.SPENVIRONMENT_BUTTONCOMMIT_ID):
             self.situatePattern(patternId, dlg.assetEnvironments())
         dlg.Destroy()
     except ARMException, errorText:
         dlg = wx.MessageDialog(self, str(errorText),
                                'Situate security pattern',
                                wx.OK | wx.ICON_ERROR)
         dlg.ShowModal()
         dlg.Destroy()
         return
 def onSelectSituate(self, evt):
     countermeasure = self.theParentDialog.objts[
         self.theParentDialog.selectedLabel]
     cmId = countermeasure.id()
     try:
         b = Borg()
         dbProxy = b.dbProxy
         patterns = dbProxy.getDimensionNames('securitypattern')
         cDlg = DimensionNameDialog(self, 'securitypattern', patterns,
                                    'Select')
         if (cDlg.ShowModal() == DIMNAME_BUTTONACTION_ID):
             patternName = cDlg.dimensionName()
             patternId = dbProxy.getDimensionId(patternName,
                                                'securitypattern')
             spDlg = SecurityPatternEnvironmentDialog(
                 self, patternId, countermeasure.environments())
             if (spDlg.ShowModal() == SPENVIRONMENT_BUTTONCOMMIT_ID):
                 self.situatePattern(patternId, spDlg.assetEnvironments())
             spDlg.Destroy()
             dbProxy.addTrace('countermeasure_securitypattern', cmId,
                              patternId)
         cDlg.Destroy()
     except ARMException, errorText:
         dlg = wx.MessageDialog(self, str(errorText),
                                'Generate countermeasure asset',
                                wx.OK | wx.ICON_ERROR)
         dlg.ShowModal()
         dlg.Destroy()
         return