本文整理汇总了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())
示例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
示例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
示例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()
示例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
示例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()
示例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
示例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
示例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
示例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
示例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())
示例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())
示例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
示例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()
示例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())