本文整理汇总了Python中DimensionNameDialog.DimensionNameDialog.dimensionNames方法的典型用法代码示例。如果您正苦于以下问题:Python DimensionNameDialog.dimensionNames方法的具体用法?Python DimensionNameDialog.dimensionNames怎么用?Python DimensionNameDialog.dimensionNames使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DimensionNameDialog.DimensionNameDialog
的用法示例。
在下文中一共展示了DimensionNameDialog.dimensionNames方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: onAddDimension
# 需要导入模块: from DimensionNameDialog import DimensionNameDialog [as 别名]
# 或者: from DimensionNameDialog.DimensionNameDialog import dimensionNames [as 别名]
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)
示例2: onAddDimension
# 需要导入模块: from DimensionNameDialog import DimensionNameDialog [as 别名]
# 或者: from DimensionNameDialog.DimensionNameDialog import dimensionNames [as 别名]
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)
示例3: onAddDimension
# 需要导入模块: from DimensionNameDialog import DimensionNameDialog [as 别名]
# 或者: from DimensionNameDialog.DimensionNameDialog import dimensionNames [as 别名]
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)
示例4: onSituate
# 需要导入模块: from DimensionNameDialog import DimensionNameDialog [as 别名]
# 或者: from DimensionNameDialog.DimensionNameDialog import dimensionNames [as 别名]
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
示例5: onAddDimension
# 需要导入模块: from DimensionNameDialog import DimensionNameDialog [as 别名]
# 或者: from DimensionNameDialog.DimensionNameDialog import dimensionNames [as 别名]
def onAddDimension(self,evt):
dimensions = self.dbProxy.getDimensionNames(self.theDimensionTable,self.theCurrentEnvironment)
from DimensionNameDialog import DimensionNameDialog
dlg = DimensionNameDialog(self,self.theDimensionTable,dimensions,'Add')
if (dlg.ShowModal() == DIMNAME_BUTTONACTION_ID):
newRoles = dlg.dimensionNames()
for additionalDimension in newRoles:
idx = self.GetItemCount()
self.InsertStringItem(idx,additionalDimension)
tpDict = self.dbProxy.roleTasks(self.theCurrentEnvironment,newRoles)
noOfPersonas = self.thePersonaList.GetItemCount()
if (noOfPersonas > 0):
currentKeys = set([])
for x in range(noOfPersonas):
listedTask = self.thePersonaList.GetItem(x,0)
listedPersona = self.thePersonaList.GetItem(x,1)
listedTuple = (listedTask.GetText(),listedPersona.GetText())
currentKeys.add(listedTuple)
for personaDetails in tpDict.iteritems():
key = personaDetails[0]
value = personaDetails[1]
if ((key[0],key[1]) not in currentKeys):
self.thePersonaList.InsertStringItem(0,key[0])
self.thePersonaList.SetStringItem(0,1,key[1])
self.thePersonaList.SetStringItem(0,2,value[0])
self.thePersonaList.SetStringItem(0,3,value[1])
self.thePersonaList.SetStringItem(0,4,value[2])
self.thePersonaList.SetStringItem(0,5,value[3])
else:
for personaDetails in tpDict.iteritems():
key = personaDetails[0]
value = personaDetails[1]
self.thePersonaList.InsertStringItem(0,key[0])
self.thePersonaList.SetStringItem(0,1,key[1])
self.thePersonaList.SetStringItem(0,2,value[0])
self.thePersonaList.SetStringItem(0,3,value[1])
self.thePersonaList.SetStringItem(0,4,value[2])
self.thePersonaList.SetStringItem(0,5,value[3])