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


Python DimensionNameDialog.dimensionName方法代码示例

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


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

示例1: onInheritEnvironment

# 需要导入模块: from DimensionNameDialog import DimensionNameDialog [as 别名]
# 或者: from DimensionNameDialog.DimensionNameDialog import dimensionName [as 别名]
 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,代码行数:12,代码来源:EnvironmentListCtrl.py

示例2: onAdd

# 需要导入模块: from DimensionNameDialog import DimensionNameDialog [as 别名]
# 或者: from DimensionNameDialog.DimensionNameDialog import dimensionName [as 别名]
 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,代码行数:28,代码来源:ResponsesDialog.py

示例3: onRemovePattern

# 需要导入模块: from DimensionNameDialog import DimensionNameDialog [as 别名]
# 或者: from DimensionNameDialog.DimensionNameDialog import dimensionName [as 别名]
 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,代码行数:30,代码来源:CountermeasureListCtrl.py

示例4: onListAlphabet

# 需要导入模块: from DimensionNameDialog import DimensionNameDialog [as 别名]
# 或者: from DimensionNameDialog.DimensionNameDialog import dimensionName [as 别名]
 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,代码行数:10,代码来源:CodingTextCtrl.py

示例5: onAddDimension

# 需要导入模块: from DimensionNameDialog import DimensionNameDialog [as 别名]
# 或者: from DimensionNameDialog.DimensionNameDialog import dimensionName [as 别名]
 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,代码行数:10,代码来源:TargetListBox.py

示例6: onReassociate

# 需要导入模块: from DimensionNameDialog import DimensionNameDialog [as 别名]
# 或者: from DimensionNameDialog.DimensionNameDialog import dimensionName [as 别名]
 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,代码行数:17,代码来源:RequirementsGrid.py

示例7: onAssociateSituated

# 需要导入模块: from DimensionNameDialog import DimensionNameDialog [as 别名]
# 或者: from DimensionNameDialog.DimensionNameDialog import dimensionName [as 别名]
 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,代码行数:19,代码来源:CountermeasureListCtrl.py

示例8: onSelectGenerateFromTemplate

# 需要导入模块: from DimensionNameDialog import DimensionNameDialog [as 别名]
# 或者: from DimensionNameDialog.DimensionNameDialog import dimensionName [as 别名]
 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,代码行数:20,代码来源:CountermeasureListCtrl.py

示例9: onSituate

# 需要导入模块: from DimensionNameDialog import DimensionNameDialog [as 别名]
# 或者: from DimensionNameDialog.DimensionNameDialog import dimensionName [as 别名]
 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,代码行数:20,代码来源:ComponentViewListCtrl.py

示例10: onSelectGenerate

# 需要导入模块: from DimensionNameDialog import DimensionNameDialog [as 别名]
# 或者: from DimensionNameDialog.DimensionNameDialog import dimensionName [as 别名]
  def onSelectGenerate(self,evt):
    objt = self.theParentDialog.objts[self.theParentDialog.selectedLabel]
#    objtId = objt.id()
    try:
      b = Borg()
      dbProxy = b.dbProxy
      domains = dbProxy.getDimensionNames('domain',False)
      cDlg = DimensionNameDialog(self,'domain',domains,'Select')
      if (cDlg.ShowModal() == DIMNAME_BUTTONACTION_ID):
        domainName = cDlg.dimensionName()
        GoalRequirementFactory.build(objt,domainName,self.theParentDialog.theMainWindow)
# Change domain in panel
# Add requirement
# add goalrequirement_goalassociation
    except ARMException,errorText:
      dlg = wx.MessageDialog(self,str(errorText),'Generate goal requirement',wx.OK | wx.ICON_ERROR)
      dlg.ShowModal()
      dlg.Destroy()
      return
开发者ID:AntonP1337,项目名称:cairis,代码行数:21,代码来源:GoalListCtrl.py

示例11: onUseCaseContribution

# 需要导入模块: from DimensionNameDialog import DimensionNameDialog [as 别名]
# 或者: from DimensionNameDialog.DimensionNameDialog import dimensionName [as 别名]
 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,代码行数:21,代码来源:UseCaseListCtrl.py

示例12: onUseCaseContribution

# 需要导入模块: from DimensionNameDialog import DimensionNameDialog [as 别名]
# 或者: from DimensionNameDialog.DimensionNameDialog import dimensionName [as 别名]
 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,代码行数:21,代码来源:UseCaseListCtrl.py

示例13: onSelectSituate

# 需要导入模块: from DimensionNameDialog import DimensionNameDialog [as 别名]
# 或者: from DimensionNameDialog.DimensionNameDialog import dimensionName [as 别名]
 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
开发者ID:InvalidToken,项目名称:CAIRIS,代码行数:24,代码来源:CountermeasureListCtrl.py

示例14: onTurnToGoal

# 需要导入模块: from DimensionNameDialog import DimensionNameDialog [as 别名]
# 或者: from DimensionNameDialog.DimensionNameDialog import dimensionName [as 别名]
 def onTurnToGoal(self,evt):
   b = Borg()
   p = b.dbProxy
   environments = p.getDimensionNames('environment',False)
   cDlg = DimensionNameDialog(self,'environment',environments,'Select')
   if (cDlg.ShowModal() == DIMNAME_BUTTONACTION_ID):
     environmentName = cDlg.dimensionName()
     pos = self.GetGridCursorRow() 
     table = self.GetTable()
     goalName = table.GetValue(pos,NAME_POS)
     goalDef = table.GetValue(pos,DESCRIPTION_POS)
     goalCat = 'Maintain'
     goalPri = table.GetValue(pos,PRIORITY_POS)
     goalFc = table.GetValue(pos,FITCRITERION_POS)
     goalIssue = table.GetValue(pos,RATIONALE_POS)
     goalOrig = table.GetValue(pos,ORIGINATOR_POS)
     goalAssets = [self.modCombo.GetValue()]
     dlg = ReqToGoalDialog(self,goalName,goalDef,goalCat,goalPri,goalFc,goalIssue,goalOrig,goalAssets,environmentName)
     if (dlg.ShowModal() == GOAL_BUTTONCOMMIT_ID):
       b = Borg()
       p = b.dbProxy
       p.addGoal(dlg.parameters())
       self.DeleteRows(pos)
     dlg.Destroy()
开发者ID:failys,项目名称:cairis,代码行数:26,代码来源:RequirementsGrid.py

示例15: onAdd

# 需要导入模块: from DimensionNameDialog import DimensionNameDialog [as 别名]
# 或者: from DimensionNameDialog.DimensionNameDialog import dimensionName [as 别名]
 def onAdd(self,evt):
   dims = self.dbProxy.getDimensionNames(self.theDimensionName,False)
   dlg = DimensionNameDialog(self,self.theDimensionName,dims,'Select',(300,200))
   if (dlg.ShowModal() == DIMNAME_BUTTONACTION_ID):
     self.dimList.Append(dlg.dimensionName())
开发者ID:InvalidToken,项目名称:CAIRIS,代码行数:7,代码来源:DimensionUpdateDialog.py


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