當前位置: 首頁>>代碼示例>>Python>>正文


Python DimensionNameDialog.dimensionNames方法代碼示例

本文整理匯總了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)
開發者ID:InvalidToken,項目名稱:CAIRIS,代碼行數:9,代碼來源:DimensionListBox.py

示例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)
開發者ID:InvalidToken,項目名稱:CAIRIS,代碼行數:12,代碼來源:RiskEnvironmentListCtrl.py

示例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)
開發者ID:nix4,項目名稱:CAIRIS,代碼行數:14,代碼來源:DimensionListCtrl.py

示例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
開發者ID:AntonP1337,項目名稱:cairis,代碼行數:21,代碼來源:TemplateAssetListCtrl.py

示例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])
開發者ID:InvalidToken,項目名稱:CAIRIS,代碼行數:42,代碼來源:CountermeasureRoleListCtrl.py


注:本文中的DimensionNameDialog.DimensionNameDialog.dimensionNames方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。