当前位置: 首页>>代码示例>>Python>>正文


Python DimensionNameDialog.DimensionNameDialog类代码示例

本文整理汇总了Python中DimensionNameDialog.DimensionNameDialog的典型用法代码示例。如果您正苦于以下问题:Python DimensionNameDialog类的具体用法?Python DimensionNameDialog怎么用?Python DimensionNameDialog使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了DimensionNameDialog类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: onRemovePattern

 def onRemovePattern(self,evt):
   countermeasure = self.theParentDialog.objts[self.theParentDialog.selectedLabel]
   cmId = countermeasure.id()
   try:
     b = Borg()
     dbProxy = b.dbProxy
     patterns = dbProxy.countermeasurePatterns(cmId)
     cDlg = DimensionNameDialog(self,'securitypattern',patterns,'Select')
     if (cDlg.ShowModal() == DIMNAME_BUTTONACTION_ID):
       patternName = cDlg.dimensionName()
       patternId = dbProxy.getDimensionId(patternName,'securitypattern')
       spDeps = dbProxy.reportDependencies('securitypattern',cmId)
       if (len(spDeps) > 0):
         dlg = DependentsDialog(self,spDeps,'securitypattern')
         retValue = dlg.ShowModal()
         dlg.Destroy()
         if (retValue != DEPENDENTS_BUTTONCONFIRM_ID):
           cDlg.Destroy()
           return
         else:
           dbProxy.deleteDependencies(spDeps)
       dbProxy.deleteSituatedPattern(cmId,patternName)
     cDlg.Destroy()
   except ARMException,errorText:
     dlg = wx.MessageDialog(self,str(errorText),'Generate countermeasure asset',wx.OK | wx.ICON_ERROR)
     dlg.ShowModal()
     dlg.Destroy()
     return
开发者ID:InvalidToken,项目名称:CAIRIS,代码行数:28,代码来源:CountermeasureListCtrl.py

示例2: onAddDimension

 def onAddDimension(self,evt):
   dimensions = self.dbProxy.getDimensionNames(self.theDimensionTable)
   from DimensionNameDialog import DimensionNameDialog
   dlg = DimensionNameDialog(self,self.theDimensionTable,dimensions,'Add')
   if (dlg.ShowModal() == DIMNAME_BUTTONACTION_ID):
     for additionalDimension in dlg.dimensionNames():
       self.Append(additionalDimension)
开发者ID:InvalidToken,项目名称:CAIRIS,代码行数:7,代码来源:DimensionListBox.py

示例3: onAdd

 def onAdd(self,evt):
   try:
     riskDict = self.dbProxy.getDimensionNames('risk')
     if (len(riskDict) == 0):
       dlg = wx.MessageDialog(self,'Cannot mitigate for non-existing risks','Add response',wx.OK)
       dlg.ShowModal()
       dlg.Destroy()
       return
     responseTypes = ['Accept','Transfer','Mitigate']
     from DimensionNameDialog import DimensionNameDialog
     rtDlg = DimensionNameDialog(self,'response',responseTypes,'Select',(300,200))
     if (rtDlg.ShowModal() == DIMNAME_BUTTONACTION_ID):
       responseType = rtDlg.dimensionName()
       responsePanel = MitigateEnvironmentPanel
       if (responseType == 'Accept'):
         responsePanel = AcceptEnvironmentPanel
       elif (responseType == 'Transfer'):
         responsePanel = TransferEnvironmentPanel
       addParameters = ResponseDialogParameters(RESPONSE_ID,'Add response',ResponseDialog,RESPONSE_BUTTONCOMMIT_ID,self.dbProxy.addResponse,True,responsePanel,responseType)
       self.addObject(addParameters)
     rtDlg.Destroy()
   except ARMException,errorText:
     dlg = wx.MessageDialog(self,str(errorText),'Add response',wx.OK | wx.ICON_ERROR)
     dlg.ShowModal()
     dlg.Destroy()
     return
开发者ID:AntonP1337,项目名称:cairis,代码行数:26,代码来源:ResponsesDialog.py

示例4: onAddDimension

 def onAddDimension(self,evt):
   targetList = self.dbProxy.targetNames(self.theRiskList.GetItems())
   from DimensionNameDialog import DimensionNameDialog
   dlg = DimensionNameDialog(self,'Target',targetList,'Add')
   if (dlg.ShowModal() == armid.DIMNAME_BUTTONACTION_ID):
     additionalDimension = dlg.dimensionName()
     self.Append(additionalDimension)
     self.theSelectedValue = additionalDimension
开发者ID:RachelLar,项目名称:CAIRIS-web,代码行数:8,代码来源:TargetListBox.py

示例5: onListAlphabet

 def onListAlphabet(self,evt):
   b = Borg()
   codes = b.dbProxy.getDimensionNames('code',False)
   cDlg = DimensionNameDialog(self,'code',codes,'Select')
   if (cDlg.ShowModal() == DIMNAME_BUTTONACTION_ID):
     codeName = cDlg.dimensionName()
     self.addCode(codeName)
   cDlg.Destroy()
开发者ID:InvalidToken,项目名称:CAIRIS,代码行数:8,代码来源:CodingTextCtrl.py

示例6: onAddDimension

 def onAddDimension(self,evt):
   currentDimensions = self.dimensions()
   dimensions = self.dbProxy.riskEnvironmentNames(self.theCurrentRisk)
   remainingDimensions = [x for x in dimensions if x not in currentDimensions]
   from DimensionNameDialog import DimensionNameDialog
   dlg = DimensionNameDialog(self,self.theDimensionTable,remainingDimensions,'Add')
   if (dlg.ShowModal() == DIMNAME_BUTTONACTION_ID):
     for additionalDimension in dlg.dimensionNames():
       idx = self.GetItemCount()
       self.InsertStringItem(idx,additionalDimension)
开发者ID:InvalidToken,项目名称:CAIRIS,代码行数:10,代码来源:RiskEnvironmentListCtrl.py

示例7: onInheritEnvironment

 def onInheritEnvironment(self,evt):
   from DimensionNameDialog import DimensionNameDialog
   dimensions = self.dbProxy.getEnvironmentNames()
   dlg = DimensionNameDialog(self,'environment',dimensions,'Inherit from ')
   if (dlg.ShowModal() == DIMNAME_BUTTONACTION_ID):
     self.theInheritedEnvironment = dlg.dimensionName()
     adddlg = DimensionNameDialog(self,'environment',dimensions,'Add')
     if (adddlg.ShowModal() == DIMNAME_BUTTONACTION_ID):
       idx = self.GetItemCount()
       self.InsertStringItem(idx,adddlg.dimensionName())
开发者ID:AntonP1337,项目名称:cairis,代码行数:10,代码来源:EnvironmentListCtrl.py

示例8: onAddDimension

    def onAddDimension(self, evt):
        if self.theDimensionTable == "environment":
            dimensions = self.dbProxy.getEnvironmentNames()
        else:
            dimensions = self.dbProxy.getDimensionNames(self.theDimensionTable, self.theCurrentEnvironment)
        from DimensionNameDialog import DimensionNameDialog

        dlg = DimensionNameDialog(self, self.theDimensionTable, dimensions, "Add")
        if dlg.ShowModal() == armid.DIMNAME_BUTTONACTION_ID:
            for additionalDimension in dlg.dimensionNames():
                idx = self.GetItemCount()
                self.InsertStringItem(idx, additionalDimension)
开发者ID:nix4,项目名称:CAIRIS,代码行数:12,代码来源:DimensionListCtrl.py

示例9: onReassociate

 def onReassociate(self,evt):
   b = Borg()
   p = b.dbProxy
   dimensions = p.getDimensionNames('asset')
   dlg = DimensionNameDialog(self,'asset',dimensions,'Select')
   if (dlg.ShowModal() == DIMNAME_BUTTONACTION_ID):
     selectedAsset = dlg.dimensionName()
     reqTable = self.GetTable()
     selectedReq = reqTable.om.reqs[self.GetGridCursorRow()]
     p.reassociateAsset(selectedAsset,self.envCombo.GetValue(),selectedReq.id())
     self.modCombo.SetStringSelection(selectedAsset)
   dlg.Destroy()
   self.envCombo.SetValue('')
   self.setTable(self.modCombo,self.envCombo)
   self.thePanel.refresh()
开发者ID:failys,项目名称:cairis,代码行数:15,代码来源:RequirementsGrid.py

示例10: onAssociateSituated

 def onAssociateSituated(self,evt):
   countermeasure = self.theParentDialog.objts[self.theParentDialog.selectedLabel]
   cmId = countermeasure.id()
   try:
     b = Borg()
     dbProxy = b.dbProxy
     patterns = dbProxy.candidateCountermeasurePatterns(cmId)
     cDlg = DimensionNameDialog(self,'securitypattern',patterns,'Select')
     if (cDlg.ShowModal() == DIMNAME_BUTTONACTION_ID):
       patternName = cDlg.dimensionName()
       dbProxy.associateCountermeasureToPattern(cmId,patternName)
     cDlg.Destroy()
   except ARMException,errorText:
     dlg = wx.MessageDialog(self,str(errorText),'Generate countermeasure asset',wx.OK | wx.ICON_ERROR)
     dlg.ShowModal()
     dlg.Destroy()
     return
开发者ID:InvalidToken,项目名称:CAIRIS,代码行数:17,代码来源:CountermeasureListCtrl.py

示例11: onSelectGenerateFromTemplate

 def onSelectGenerateFromTemplate(self,evt):
   countermeasure = self.theParentDialog.objts[self.theParentDialog.selectedLabel]
   cmId = countermeasure.id()
   try:
     b = Borg()
     dbProxy = b.dbProxy
     templateAssets = dbProxy.getDimensionNames('template_asset')
     cDlg = DimensionNameDialog(self,'template_asset',templateAssets,'Select')
     if (cDlg.ShowModal() == DIMNAME_BUTTONACTION_ID):
       templateAssetName = cDlg.dimensionName()
       assetId = dbProxy.addAsset(cairis.core.AssetParametersFactory.buildFromTemplate(templateAssetName,countermeasure.environments()))
       dbProxy.addTrace('countermeasure_asset',cmId,assetId)
       cDlg.Destroy()
   except ARMException,errorText:
     dlg = wx.MessageDialog(self,str(errorText),'Generate countermeasure asset',wx.OK | wx.ICON_ERROR)
     dlg.ShowModal()
     dlg.Destroy()
     return
开发者ID:InvalidToken,项目名称:CAIRIS,代码行数:18,代码来源:CountermeasureListCtrl.py

示例12: onSituate

 def onSituate(self,evt):
   cvObjt = self.theParentDialog.objts[self.theParentDialog.selectedLabel]
   cvName = cvObjt.name()
   try:
     environments = self.dbProxy.getDimensionNames('environment',False)
     cDlg = DimensionNameDialog(self,'environment',environments,'Select')
     if (cDlg.ShowModal() == armid.DIMNAME_BUTTONACTION_ID):
       envName = cDlg.dimensionName()
       dlg = WeaknessAnalysisDialog(self,cvName,envName)
       if (dlg.ShowModal() == armid.WEAKNESSANALYSIS_BUTTONCOMMIT_ID):
         self.situateComponentView(cvName,envName,dlg.targets(),dlg.goalObstacles())
       dlg.Destroy()
     cDlg.Destroy()
   except ARMException,errorText:
     dlg = wx.MessageDialog(self,str(errorText),'Situate component view',wx.OK | wx.ICON_ERROR)
     dlg.ShowModal()
     dlg.Destroy()
     return
开发者ID:RachelLar,项目名称:CAIRIS-web,代码行数:18,代码来源:ComponentViewListCtrl.py

示例13: onSituate

  def onSituate(self,evt):
    tAsset = self.theParentDialog.objts[self.theParentDialog.selectedLabel]
    taId = tAsset.id()
    taName = tAsset.name()
    try:
      b = Borg()
      dbProxy = b.dbProxy
      envs = dbProxy.getEnvironmentNames()
      cDlg = DimensionNameDialog(self,'environment',envs,'Select')
      if (cDlg.ShowModal() == DIMNAME_BUTTONACTION_ID):
        sitEnvs = cDlg.dimensionNames()
        assetId = dbProxy.addAsset(cairis.core.AssetParametersFactory.buildFromTemplate(taName,sitEnvs))
# NB: we don't add anything to asset_template_asset, as we only use this table when the derived asset is part of a situated pattern
        cDlg.Destroy()
    except ARMException,errorText:
      dlg = wx.MessageDialog(self,str(errorText),'Situate template asset',wx.OK | wx.ICON_ERROR)
      dlg.ShowModal()
      dlg.Destroy()
      return
开发者ID:AntonP1337,项目名称:cairis,代码行数:19,代码来源:TemplateAssetListCtrl.py

示例14: onUseCaseContribution

 def onUseCaseContribution(self, evt):
     ucName = self.GetItemText(self.theSelectedIdx)
     ucs = self.dbProxy.getUseCaseContributions(ucName)
     ucKeys = ucs.keys()
     ucKeys.append("[New Contribution]")
     rsDlg = DimensionNameDialog(self, "usecase_contribution", ucKeys, "Select")
     if rsDlg.ShowModal() == DIMNAME_BUTTONACTION_ID:
         synName = rsDlg.dimensionName()
         rType = "reference"
         if synName != "[New Contribution]":
             rc, rType = ucs[synName]
         else:
             rc = ReferenceContribution(ucName, "", "", "")
         dlg = UseCaseContributionDialog(self, rc, rType)
         if dlg.ShowModal() == REFERENCECONTRIBUTION_BUTTONCOMMIT_ID:
             if rc.meansEnd() == "":
                 self.dbProxy.addUseCaseContribution(dlg.parameters())
             else:
                 self.dbProxy.updateUseCaseContribution(dlg.parameters())
开发者ID:failys,项目名称:cairis,代码行数:19,代码来源:UseCaseListCtrl.py

示例15: onUseCaseContribution

 def onUseCaseContribution(self,evt):
   ucName = self.GetItemText(self.theSelectedIdx)
   ucs  = self.dbProxy.getUseCaseContributions(ucName)
   ucKeys = ucs.keys()
   ucKeys.append('[New Contribution]')
   rsDlg = DimensionNameDialog(self,'usecase_contribution',ucKeys,'Select')
   if (rsDlg.ShowModal() == DIMNAME_BUTTONACTION_ID):
     synName = rsDlg.dimensionName()
     rType = 'reference'
     if (synName != '[New Contribution]'):
       rc,rType = ucs[synName]
     else:
       rc = ReferenceContribution(ucName,'','','')
     dlg = UseCaseContributionDialog(self,rc,rType)
     if (dlg.ShowModal() == REFERENCECONTRIBUTION_BUTTONCOMMIT_ID):
       if (rc.meansEnd() == ''):
         self.dbProxy.addUseCaseContribution(dlg.parameters())
       else:
         self.dbProxy.updateUseCaseContribution(dlg.parameters())
开发者ID:AntonP1337,项目名称:cairis,代码行数:19,代码来源:UseCaseListCtrl.py


注:本文中的DimensionNameDialog.DimensionNameDialog类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。