• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python NDImplementationDecorator.NDImplementationDecorator类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: __init__

class AssignResponsibilityNodeDialog:
  def __init__(self,objt,environmentName,builder,goalName,isGoal = True):
    self.window = builder.get_object("AssignResponsibilityNodeDialog")
    b = Borg()
    self.isGoalIndicator = isGoal
    self.dbProxy = b.dbProxy
    self.theEnvironmentName = environmentName
    self.theGoalName = goalName
    self.decorator = NDImplementationDecorator(builder)
    self.theObjtId = objt.id()

    roles = self.dbProxy.getDimensionNames('role')
    self.decorator.updateComboCtrl("roleRespNameCtrl",roles,'')
    self.window.resize(350,200)

  def on_roleResponsibilityOkButton_clicked(self,callback_data):
    roleName = self.decorator.getComboValue("roleRespNameCtrl")
    if (self.isGoalIndicator == False):
      roleId = self.dbProxy.getDimensionId(roleName,'role')
      self.dbProxy.addTrace('requirement_role',self.theObjtId,roleId)
    else: 
      goalDim = 'goal'
      if (self.isGoalIndicator == False):
        goalDim = 'requirement'
      parameters = GoalAssociationParameters(self.theEnvironmentName,self.theGoalName,goalDim,'responsible',roleName,'role')
      self.dbProxy.addGoalAssociation(parameters)
    self.window.destroy()

  def show(self):
    self.window.show()
开发者ID:InvalidToken,项目名称:CAIRIS,代码行数:30,代码来源:AssignResponsibilityNodeDialog.py


示例2: __init__

class ComponentNodeDialog:
  def __init__(self,objt,builder):
    self.window = builder.get_object("ComponentNodeDialog")
    self.decorator = NDImplementationDecorator(builder)
    componentName = objt.name()
    self.decorator.updateTextCtrl("componentNameCtrl",componentName)
    self.decorator.updateMLTextCtrl("componentDescriptionCtrl",objt.description())

    cifs  = []
    for cif in objt.interfaces():
      cifs.append([cif[0],cif[1]])
    self.decorator.updateListCtrl("componentInterfacesCtrl",['Name','Type'],gtk.ListStore(str,str),cifs)

    cStructure = []
    for csRow  in objt.structure():
      cStructure.append([csRow[0],csRow[1],csRow[2],csRow[3],csRow[4],csRow[5],csRow[6],csRow[7],csRow[8],csRow[9]])
    self.decorator.updateListCtrl("componentStructureCtrl",['Head Asset','Type','Nav','Nry','Role','Tail Role','Tail Nry','Tail Nav','Tail Type','Tail Asset'],gtk.ListStore(str,str,str,str,str,str,str,str,str,str),cStructure)

    reqs  = []
    for req in objt.requirements():
      reqs.append([req])
    self.decorator.updateListCtrl("componentRequirementsCtrl",['Name'],gtk.ListStore(str),reqs)

    self.window.resize(350,300)

  def on_componentOkButton_clicked(self,callback_data):
    self.window.destroy()

  def show(self):
    self.window.show()
开发者ID:InvalidToken,项目名称:CAIRIS,代码行数:30,代码来源:ComponentNodeDialog.py


示例3: __init__

class AttackerNodeDialog:
  def __init__(self,objt,environmentName,dupProperty,overridingEnvironment,builder):
    self.window = builder.get_object("AttackerNodeDialog")
    self.decorator = NDImplementationDecorator(builder)
    self.decorator.updateTextCtrl("attackerNameCtrl",objt.name())
    roles = []
    for role in objt.roles(environmentName,dupProperty):
      roles.append([role]) 
    self.decorator.updateListCtrl("attackerRolesCtrl",['Role'],gtk.ListStore(str),roles)
    capabilities = []
    for cap,value in objt.capability(environmentName,dupProperty):
      capabilities.append([cap,value]) 
    self.decorator.updateListCtrl("attackerCapabilityCtrl",['Capability','Value'],gtk.ListStore(str,str),capabilities)
    motives = []
    for motive in objt.motives(environmentName,dupProperty):
      motives.append([motive]) 
    self.decorator.updateListCtrl("attackerMotiveCtrl",['Motive'],gtk.ListStore(str),motives)
    self.decorator.updateMLTextCtrl("attackerDescriptionCtrl",objt.description())

    self.window.resize(350,300)

  def on_attackerOkButton_clicked(self,callback_data):
    self.window.destroy()

  def show(self):
    self.window.show()
开发者ID:AntonP1337,项目名称:cairis,代码行数:26,代码来源:AttackerNodeDialog.py


示例4: __init__

class MitigateNodeDialog:
    def __init__(self, objt, environmentName, dupProperty, overridingEnvironment, builder):
        self.window = builder.get_object("MitigateNodeDialog")
        self.decorator = NDImplementationDecorator(builder)
        self.decorator.updateTextCtrl("mitigateNameCtrl", objt.name())
        self.decorator.updateTextCtrl("mitigateRiskCtrl", objt.risk())
        mitType = objt.type(environmentName, dupProperty, overridingEnvironment)
        self.decorator.updateTextCtrl("mitigateTypeCtrl", mitType)

        dpFrame = builder.get_object("mitigateDetectionPointFrame")
        dmFrame = builder.get_object("mitigateDetectionMechanismsFrame")
        if mitType == "Detect":
            self.decorator.updateTextCtrl(
                "mitigateDetectionPointCtrl", objt.detectionPoint(environmentName, dupProperty, overridingEnvironment)
            )
            dmFrame.hide()
        elif mitType == "React":
            dms = []
            for dm in objt.detectionMechanisms(environmentName, dupProperty, overridingEnvironment):
                dms.append([dm])
            self.decorator.updateListCtrl(
                "mitigateDetectionMechanismsCtrl", ["Detection Mechanism"], gtk.ListStore(str), dms
            )
            dpFrame.hide()
        else:
            dpFrame.hide()
            dmFrame.hide()
        self.window.resize(300, 300)

    def on_mitigateOkButton_clicked(self, callback_data):
        self.window.destroy()

    def show(self):
        self.window.show()
开发者ID:failys,项目名称:cairis,代码行数:34,代码来源:MitigateNodeDialog.py


示例5: __init__

class DomainPropertyNodeDialog:
    def __init__(self, objt, environmentName, dupProperty, overridingEnvironment, builder):
        self.window = builder.get_object("DomainPropertyNodeDialog")
        self.decorator = NDImplementationDecorator(builder)
        self.decorator.updateTextCtrl("domainPropertyNameCtrl", objt.name())
        self.decorator.updateTextCtrl("domainPropertyTypeCtrl", objt.type())
        self.decorator.updateMLTextCtrl("domainPropertyDescriptionCtrl", objt.description())

        self.window.resize(200, 200)

    def on_roleOkButton_clicked(self, callback_data):
        self.window.destroy()

    def show(self):
        self.window.show()
开发者ID:failys,项目名称:cairis,代码行数:15,代码来源:DomainPropertyNodeDialog.py


示例6: __init__

  def __init__(self,objt,environmentName,dupProperty,overridingEnvironment,builder):
    self.window = builder.get_object("UseCaseNodeDialog")
    self.decorator = NDImplementationDecorator(builder)
    self.theSteps = objt.steps(environmentName)
    ucName = objt.name()
    self.decorator.updateTextCtrl("usecaseNameCtrl",ucName)
    self.decorator.updateMLTextCtrl("usecaseDescriptionCtrl",objt.description())

    actors  = []
    for actor in objt.actors():
      actors.append([actor])
    self.decorator.updateListCtrl("usecaseActorsCtrl",['Actor'],gtk.ListStore(str),actors)

    self.decorator.updateMLTextCtrl("usecasePreconditionsCtrl",objt.preconditions(environmentName))

    steps = []
    for s in self.theSteps:
      steps.append([s]) 
    self.decorator.updateListCtrl("usecaseStepsCtrl",['Step'],gtk.ListStore(str),steps)

    stepExceptions = (self.theSteps[0]).exceptions()
    excs = []
    for e in stepExceptions:
      excs.append([e])
    self.decorator.updateListCtrl("usecaseExceptionCtrl",['Exception'],gtk.ListStore(str),excs)

    self.decorator.updateMLTextCtrl("usecasePostconditionsCtrl",objt.postconditions(environmentName))

    self.window.resize(350,300)
开发者ID:InvalidToken,项目名称:CAIRIS,代码行数:29,代码来源:UseCaseNodeDialog.py


示例7: __init__

 def __init__(self,objt,environmentName,dupProperty,overridingEnvironment,builder):
   self.window = builder.get_object("GoalNodeDialog")
   b = Borg()
   self.dbProxy = b.dbProxy
   self.theEnvironmentName = environmentName
   self.theGoalAssociation = None
   self.theGoalId = -1
   self.decorator = NDImplementationDecorator(builder)
   goalCategories = self.dbProxy.getDimensionNames('goal_category_type')
   priorityTypes = self.dbProxy.getDimensionNames('priority_type')
   self.goalAssociations = []
   self.subGoalAssociations= []
   if (objt == None):
     self.decorator.updateComboCtrl("goalCategoryCtrl",goalCategories,'')
     self.decorator.updateComboCtrl("goalPriorityCtrl",priorityTypes,'')
     self.decorator.updateButtonLabel("goalOkButton","Create")
     self.isCreate = True
   else:
     self.theGoalId = objt.id()
     envProperty = objt.environmentProperty(self.theEnvironmentName)
     self.goalAssociations = envProperty.goalRefinements()
     self.subGoalAssociations = envProperty.subGoalRefinements()
     self.decorator.updateTextCtrl("goalNameCtrl",objt.name())
     self.decorator.updateMLTextCtrl("goalDefinitionCtrl",objt.definition(environmentName,dupProperty))
     self.decorator.updateComboCtrl("goalCategoryCtrl",goalCategories,objt.category(environmentName,dupProperty))
     self.decorator.updateComboCtrl("goalPriorityCtrl",priorityTypes,objt.priority(environmentName,dupProperty))
     self.decorator.updateMLTextCtrl("goalFitCriterionCtrl",objt.fitCriterion(environmentName,dupProperty))
     self.decorator.updateMLTextCtrl("goalIssueCtrl",objt.issue(environmentName,dupProperty))
     self.decorator.updateButtonLabel("goalOkButton","Update")
     self.isCreate = False
   self.window.resize(350,600)
开发者ID:InvalidToken,项目名称:CAIRIS,代码行数:31,代码来源:GoalNodeDialog.py


示例8: __init__

  def __init__(self,objt,environmentName,dupProperty,overridingEnvironment,builder):
    self.window = builder.get_object("TaskNodeDialog")
    self.decorator = NDImplementationDecorator(builder)
    taskName = objt.name()
    self.decorator.updateTextCtrl("taskNameCtrl",taskName)
    self.decorator.updateTextCtrl("taskObjectiveCtrl",objt.objective())
    self.decorator.updateMLTextCtrl("taskDependenciesCtrl",objt.dependencies(environmentName,dupProperty))

    personas  = []
    for persona in objt.personas(environmentName,dupProperty,overridingEnvironment):
      personas.append([persona[0],persona[1],persona[2],persona[3],persona[4]])
    self.decorator.updateListCtrl("taskPersonasCtrl",['Persona','Duration','Frequency','Demands','Goal conflict'],gtk.ListStore(str,str,str,str,str),personas)

    assets = []
    for asset in objt.assets(environmentName,dupProperty):
      assets.append([asset])
    self.decorator.updateListCtrl("taskAssetsCtrl",['Asset'],gtk.ListStore(str),assets)

    b = Borg()
    proxy = b.dbProxy
    self.decorator.updateTextCtrl("taskUsabilityCtrl",str(proxy.taskUsabilityScore(taskName,environmentName)))

    taskId = proxy.getDimensionId(taskName,'task')
    environmentId = proxy.getDimensionId(environmentName,'environment')
    self.decorator.updateTextCtrl("taskTaskLoadCtrl",str(proxy.taskLoad(taskId,environmentId)))
    self.decorator.updateTextCtrl("taskCountermeasureLoadCtrl",str(proxy.countermeasureLoad(taskId,environmentId)))
    self.decorator.updateMLTextCtrl("taskNarrativeCtrl",objt.narrative(environmentName,dupProperty))
    self.window.resize(350,300)
开发者ID:AntonP1337,项目名称:cairis,代码行数:28,代码来源:TaskNodeDialog.py


示例9: __init__

 def __init__(self, objt, environmentName, dupProperty, overridingEnvironment, builder):
     self.window = builder.get_object("ObstacleNodeDialog")
     b = Borg()
     self.dbProxy = b.dbProxy
     self.theEnvironmentName = environmentName
     self.theObstacleAssociation = None
     self.theObstacleId = -1
     self.decorator = NDImplementationDecorator(builder)
     obstacleCategories = self.dbProxy.getDimensionNames("obstacle_category_type")
     self.obstacleAssociations = []
     self.subObstacleAssociations = []
     if objt == None:
         self.decorator.updateComboCtrl("obstacleCategoryCtrl", obstacleCategories, "")
         self.decorator.updateButtonLabel("obstacleOkButton", "Create")
         self.isCreate = True
     else:
         self.theObstacleId = objt.id()
         envProperty = objt.environmentProperty(self.theEnvironmentName)
         self.obstacleAssociations = envProperty.goalRefinements()
         self.subObstacleAssociations = envProperty.subGoalRefinements()
         self.decorator.updateTextCtrl("obstacleNameCtrl", objt.name())
         self.decorator.updateComboCtrl(
             "obstacleCategoryCtrl", obstacleCategories, objt.category(environmentName, dupProperty)
         )
         self.decorator.updateMLTextCtrl("obstacleDefinitionCtrl", objt.definition(environmentName, dupProperty))
         self.decorator.updateButtonLabel("obstacleOkButton", "Update")
         self.isCreate = False
     self.window.resize(350, 600)
开发者ID:failys,项目名称:cairis,代码行数:28,代码来源:ObstacleNodeDialog.py


示例10: __init__

  def __init__(self,objt,environmentName,dupProperty,overridingEnvironment,builder):
    self.window = builder.get_object("CountermeasureNodeDialog")
    self.decorator = NDImplementationDecorator(builder)
    self.decorator.updateTextCtrl("countermeasureNameCtrl",objt.name())
    self.decorator.updateMLTextCtrl("countermeasureDescriptionCtrl",objt.description())
    self.decorator.updateTextCtrl("countermeasureCostCtrl",objt.cost(environmentName,dupProperty,overridingEnvironment))

    reqs = []
    for req in set(objt.requirements(environmentName,dupProperty,overridingEnvironment)):
      reqs.append([req])
    self.decorator.updateListCtrl("countermeasureRequirementsCtrl",['Requirement'],gtk.ListStore(str),reqs)

    targets = []
    for target in objt.targets(environmentName,dupProperty,overridingEnvironment):
      targets.append([target.name(),target.effectiveness()])
    self.decorator.updateListCtrl("countermeasureTargetsCtrl",['Target','Effectiveness'],gtk.ListStore(str,str),targets)

    self.decorator.updateListCtrl("countermeasurePropertiesCtrl",['Property','Value'],gtk.ListStore(str,str),objt.propertyList(environmentName,dupProperty,overridingEnvironment))

    roles = []
    for role in objt.roles(environmentName,dupProperty,overridingEnvironment):
      roles.append([role])
    self.decorator.updateListCtrl("countermeasureRolesCtrl",['Role'],gtk.ListStore(str),roles)

    tps  = []
    for tp in objt.personas(environmentName,dupProperty,overridingEnvironment):
      tps.append([tp[0],tp[1],tp[2],tp[3],tp[4],tp[5]])
    self.decorator.updateListCtrl("countermeasureTaskPersonasCtrl",['Task','Persona','Duration','Frequency','Demands','Goals'],gtk.ListStore(str,str,str,str,str,str),tps)


    self.window.resize(500,300)
开发者ID:InvalidToken,项目名称:CAIRIS,代码行数:31,代码来源:CountermeasureNodeDialog.py


示例11: __init__

  def __init__(self,refName,docName,docExc,builder):
    self.window = builder.get_object("DocumentReferenceNodeDialog")
    self.decorator = NDImplementationDecorator(builder)
    self.decorator.updateTextCtrl("documentReferenceNameCtrl",refName)
    self.decorator.updateTextCtrl("documentReferenceDocumentCtrl",docName)
    self.decorator.updateMLTextCtrl("documentReferenceExcerptCtrl",docExc)

    self.window.resize(350,200)
开发者ID:InvalidToken,项目名称:CAIRIS,代码行数:8,代码来源:DocumentReferenceNodeDialog.py


示例12: __init__

 def __init__(self,objt,environmentName,dupProperty,overridingEnvironment,builder):
   self.window = builder.get_object("AssetNodeDialog")
   self.decorator = NDImplementationDecorator(builder)
   self.decorator.updateTextCtrl("assetNameCtrl",objt.name())
   self.decorator.updateMLTextCtrl("assetDescriptionCtrl",objt.description())
   self.decorator.updateMLTextCtrl("assetSignificanceCtrl",objt.significance())
   self.decorator.updateListCtrl("assetPropertiesCtrl",['Property','Value'],gtk.ListStore(str,str),objt.propertyList(environmentName,dupProperty,overridingEnvironment))
   self.window.resize(350,350)
开发者ID:InvalidToken,项目名称:CAIRIS,代码行数:8,代码来源:AssetNodeDialog.py


示例13: __init__

 def __init__(self,objt,environmentName,dupProperty,overridingEnvironment,builder):
   self.window = builder.get_object("AcceptNodeDialog")
   self.decorator = NDImplementationDecorator(builder)
   self.decorator.updateTextCtrl("acceptNameCtrl",objt.name())
   self.decorator.updateTextCtrl("acceptRiskCtrl",objt.risk())
   self.decorator.updateTextCtrl("acceptCostCtrl",objt.cost(environmentName,dupProperty,overridingEnvironment))
   self.decorator.updateMLTextCtrl("acceptRationaleCtrl",objt.description(environmentName,dupProperty,overridingEnvironment))
   self.window.resize(300,300)
开发者ID:AntonP1337,项目名称:cairis,代码行数:8,代码来源:AcceptNodeDialog.py


示例14: __init__

 def __init__(self,objt,builder):
   self.window = builder.get_object("DomainNodeDialog")
   self.decorator = NDImplementationDecorator(builder)
   self.decorator.updateTextCtrl("domainNameCtrl",objt.name())
   self.decorator.updateTextCtrl("domainTypeCtrl",objt.type())
   self.decorator.updateTextCtrl("domainShortCodeCtrl",objt.shortCode())
   self.decorator.updateMLTextCtrl("domainDescriptionCtrl",objt.description())
   self.window.resize(350,350)
开发者ID:AntonP1337,项目名称:cairis,代码行数:8,代码来源:DomainNodeDialog.py


示例15: __init__

  def __init__(self,refName,dimName,objtName,refDesc,builder):
    self.window = builder.get_object("ConceptReferenceNodeDialog")
    self.decorator = NDImplementationDecorator(builder)
    self.decorator.updateTextCtrl("conceptReferenceNameCtrl",refName)
    self.decorator.updateTextCtrl("conceptReferenceTypeCtrl",dimName)
    self.decorator.updateTextCtrl("conceptReferenceArtifactCtrl",objtName)
    self.decorator.updateMLTextCtrl("conceptReferenceDescriptionCtrl",refDesc)

    self.window.resize(350,200)
开发者ID:InvalidToken,项目名称:CAIRIS,代码行数:9,代码来源:ConceptReferenceNodeDialog.py


示例16: __init__

class LinkAndNodeDialog:
  def __init__(self,objt,environmentName,dupProperty,overridingEnvironment,builder):
    self.window = builder.get_object("LinkAndNodeDialog")
    self.decorator = NDImplementationDecorator(builder)
    self.decorator.updateTextCtrl("goalNameCtrl",objt.name())
    self.decorator.updateMLTextCtrl("goalDefinitionCtrl",objt.definition(environmentName,dupProperty))
    self.decorator.updateTextCtrl("goalCategoryCtrl",objt.category(environmentName,dupProperty))
    self.decorator.updateTextCtrl("goalPriorityCtrl",objt.priority(environmentName,dupProperty))
    self.decorator.updateMLTextCtrl("goalFitCriterionCtrl",objt.fitCriterion(environmentName,dupProperty))
    self.decorator.updateMLTextCtrl("goalIssueCtrl",objt.issue(environmentName,dupProperty))
    self.window.resize(350,600)


  def on_goalOkButton_clicked(self,callback_data):
    self.window.destroy()

  def show(self):
    self.window.show()
开发者ID:InvalidToken,项目名称:CAIRIS,代码行数:18,代码来源:LinkAndNodeDialog.py


示例17: __init__

 def __init__(self,objt,environmentName,dupProperty,overridingEnvironment,builder):
   self.window = builder.get_object("VulnerabilityNodeDialog")
   self.decorator = NDImplementationDecorator(builder)
   self.decorator.updateTextCtrl("vulnerabilityNameCtrl",objt.name())
   self.decorator.updateTextCtrl("vulnerabilityTypeCtrl",objt.type())
   self.decorator.updateTextCtrl("vulnerabilitySeverityCtrl",objt.severity(environmentName,dupProperty,overridingEnvironment))
   self.decorator.updateMLTextCtrl("vulnerabilityDescriptionCtrl",objt.description())
   assets = []
   for asset in objt.assets(environmentName,dupProperty):
     assets.append([asset])
   self.decorator.updateListCtrl("vulnerabilityAssetsCtrl",['Asset'],gtk.ListStore(str),assets)
   self.window.resize(300,325)
开发者ID:AntonP1337,项目名称:cairis,代码行数:12,代码来源:VulnerabilityNodeDialog.py


示例18: __init__

  def __init__(self,objt,environmentName,dupProperty,overridingEnvironment,builder):
    self.window = builder.get_object("TransferNodeDialog")
    self.decorator = NDImplementationDecorator(builder)
    self.decorator.updateTextCtrl("transferNameCtrl",objt.name())
    self.decorator.updateTextCtrl("transferRiskCtrl",objt.risk())

    roles = []
    roleList = objt.roles(environmentName,dupProperty,overridingEnvironment)
    for role in roleList:
      roles.append([role[0],role[1]])
    self.decorator.updateListCtrl("transferRolesCtrl",['Role','Cost'],gtk.ListStore(str,str),roles)
    self.decorator.updateMLTextCtrl("transferDescriptionCtrl",objt.description(environmentName,dupProperty,overridingEnvironment))
    self.window.resize(300,300)
开发者ID:InvalidToken,项目名称:CAIRIS,代码行数:13,代码来源:TransferNodeDialog.py


示例19: __init__

  def __init__(self,objt,environmentName,dupProperty,overridingEnvironment,builder):
    self.window = builder.get_object("MisuseCaseNodeDialog")
    self.decorator = NDImplementationDecorator(builder)
    self.decorator.updateTextCtrl("misuseCaseNameCtrl",objt.name())

    b = Borg()
    proxy = b.dbProxy
    environmentId = proxy.getDimensionId(environmentName,'environment')
    threatName,vulName = proxy.riskComponents(objt.risk())

    threatId = proxy.getDimensionId(threatName,'threat')
    vulId = proxy.getDimensionId(vulName,'vulnerability')
    self.decorator.updateTextCtrl("misuseCaseThreatCtrl",threatName)
    self.decorator.updateTextCtrl("misuseCaseLikelihoodCtrl",proxy.threatLikelihood(threatId,environmentId))
    self.decorator.updateTextCtrl("misuseCaseVulnerabilityCtrl",vulName)
    self.decorator.updateTextCtrl("misuseCaseSeverityCtrl",proxy.vulnerabilitySeverity(vulId,environmentId))
    self.decorator.updateTextCtrl("misuseCaseRiskRatingCtrl",proxy.riskRating(threatName,vulName,environmentName))

    attackers = proxy.threatAttackers(threatId,environmentId)
    attackerSet = set(attackers)
    attackers = []
    for attacker in attackerSet:
      attackers.append([attacker])
    self.decorator.updateListCtrl("misuseCaseAttackersCtrl",['Attacker'],gtk.ListStore(str),attackers)

    threatenedAssets = proxy.threatenedAssets(threatId,environmentId)
    vulnerableAssets = proxy.vulnerableAssets(vulId,environmentId)
    assetSet = set(threatenedAssets + vulnerableAssets)
    assets = []
    for asset in assetSet:
      assets.append([asset])
    self.decorator.updateListCtrl("misuseCaseAssetsCtrl",['Asset'],gtk.ListStore(str),assets)

    self.decorator.updateMLTextCtrl("misuseCaseNarrativeCtrl",objt.narrative(environmentName,dupProperty))

    objectiveText = 'Exploit vulnerabilities in '
    for idx,vulAsset in enumerate(vulnerableAssets):
      objectiveText += vulAsset
      if (idx != (len(vulnerableAssets) -1)):
        objectiveText += ','
    objectiveText += ' to threaten '
    for idx,thrAsset in enumerate(threatenedAssets):
      objectiveText += thrAsset
      if (idx != (len(threatenedAssets) -1)):
        objectiveText += ','
    objectiveText += '.'
    self.decorator.updateTextCtrl("misuseCaseObjectiveCtrl",objectiveText)


    self.window.resize(350,100)
开发者ID:AntonP1337,项目名称:cairis,代码行数:50,代码来源:MisuseCaseNodeDialog.py


示例20: __init__

  def __init__(self,objt,environmentName,dupProperty,overridingEnvironment,builder):
    self.window = builder.get_object("RoleNodeDialog")
    self.decorator = NDImplementationDecorator(builder)
    self.decorator.updateTextCtrl("roleNameCtrl",objt.name())
    self.decorator.updateMLTextCtrl("roleDescriptionCtrl",objt.description())
    responseCosts = []
    for responseCost in objt.responses(environmentName,dupProperty,overridingEnvironment):
      responseCosts.append([responseCost[0],responseCost[1] ])
    self.decorator.updateListCtrl("roleResponseCtrl",['Response','Cost'],gtk.ListStore(str,str),responseCosts)
    cms = []
    for cm in objt.countermeasures(environmentName,dupProperty,overridingEnvironment):
      cms.append([cm[0]])
    self.decorator.updateListCtrl("roleCountermeasureCtrl",['Countermeasure'],gtk.ListStore(str),cms)


    self.window.resize(350,200)
开发者ID:AntonP1337,项目名称:cairis,代码行数:16,代码来源:RoleNodeDialog.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python NS.NS类代码示例发布时间:2022-05-24
下一篇:
Python datetime.duck函数代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap