本文整理汇总了Python中NDImplementationDecorator.NDImplementationDecorator.updateListCtrl方法的典型用法代码示例。如果您正苦于以下问题:Python NDImplementationDecorator.updateListCtrl方法的具体用法?Python NDImplementationDecorator.updateListCtrl怎么用?Python NDImplementationDecorator.updateListCtrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NDImplementationDecorator.NDImplementationDecorator
的用法示例。
在下文中一共展示了NDImplementationDecorator.updateListCtrl方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from NDImplementationDecorator import NDImplementationDecorator [as 别名]
# 或者: from NDImplementationDecorator.NDImplementationDecorator import updateListCtrl [as 别名]
class PersonaNodeDialog:
def __init__(self,objt,environmentName,dupProperty,overridingEnvironment,builder):
self.window = builder.get_object("PersonaNodeDialog")
self.decorator = NDImplementationDecorator(builder)
self.decorator.updateTextCtrl("personaNameCtrl",objt.name())
self.decorator.updateMLTextCtrl("personaActivitiesCtrl",objt.activities())
self.decorator.updateMLTextCtrl("personaAttitudesCtrl",objt.attitudes())
self.decorator.updateMLTextCtrl("personaAptitudesCtrl",objt.aptitudes())
self.decorator.updateMLTextCtrl("personaMotivationsCtrl",objt.motivations())
self.decorator.updateMLTextCtrl("personaSkillsCtrl",objt.skills())
self.decorator.updateImageCtrl("personaImageCtrl",objt.image())
self.decorator.updateTextCtrl("personaDirectCtrl",objt.directFlag(environmentName,dupProperty))
roles = []
for role in objt.roles(environmentName,dupProperty):
roles.append([role])
self.decorator.updateListCtrl("personaRolesCtrl",['Role'],gtk.ListStore(str),roles)
self.decorator.updateMLTextCtrl("personaNarrativeCtrl",objt.narrative(environmentName,dupProperty))
self.window.resize(400,400)
def on_personaOkButton_clicked(self,callback_data):
self.window.destroy()
def show(self):
self.window.show()
示例2: __init__
# 需要导入模块: from NDImplementationDecorator import NDImplementationDecorator [as 别名]
# 或者: from NDImplementationDecorator.NDImplementationDecorator import updateListCtrl [as 别名]
class TaskNodeDialog:
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)
def on_taskOkButton_clicked(self,callback_data):
self.window.destroy()
def show(self):
self.window.show()
示例3: __init__
# 需要导入模块: from NDImplementationDecorator import NDImplementationDecorator [as 别名]
# 或者: from NDImplementationDecorator.NDImplementationDecorator import updateListCtrl [as 别名]
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()
示例4: __init__
# 需要导入模块: from NDImplementationDecorator import NDImplementationDecorator [as 别名]
# 或者: from NDImplementationDecorator.NDImplementationDecorator import updateListCtrl [as 别名]
class MisuseCaseNodeDialog:
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)
def on_misuseCaseOkButton_clicked(self,callback_data):
self.window.destroy()
def show(self):
self.window.show()
示例5: __init__
# 需要导入模块: from NDImplementationDecorator import NDImplementationDecorator [as 别名]
# 或者: from NDImplementationDecorator.NDImplementationDecorator import updateListCtrl [as 别名]
class RiskNodeDialog:
def __init__(self,objt,rating,environmentName,builder):
self.builder = builder
self.window = self.builder.get_object("RiskNodeDialog")
self.decorator = NDImplementationDecorator(builder)
self.decorator.updateTextCtrl("riskNameCtrl",objt.name())
self.decorator.updateTextCtrl("riskThreatCtrl",objt.threat())
self.detailsDict = {}
self.decorator.updateTextCtrl("riskVulnerabilityCtrl",objt.vulnerability())
self.decorator.updateTextCtrl("riskRatingCtrl",rating)
b = Borg()
proxy = b.dbProxy
riskDetails = []
riskScores = proxy.riskScore(objt.threat(),objt.vulnerability(),environmentName,objt.name())
for idx,riskScore in enumerate(riskScores):
riskDetails.append([riskScore[0],riskScore[1]])
self.detailsDict[riskScore[0]] = riskScore[2]
self.decorator.updateListCtrl("riskScoreCtrl",['Response','Score'],gtk.ListStore(str,str),riskDetails)
self.defaultSize = self.window.get_size()
detailsCtrlWindow = self.builder.get_object("riskDetailsCtrl")
detailsCtrlWindow.hide()
def on_riskOkButton_clicked(self,callback_data):
self.window.destroy()
def on_riskDetailsButton_clicked(self,callback_data):
detailsButton = self.builder.get_object("riskDetailsButton")
detailsCtrlWindow = self.builder.get_object("riskDetailsCtrl")
label = detailsButton.get_label()
if (label == 'Show Details'):
detailsButton.set_label('Hide Details')
detailsCtrlWindow.show()
self.window.resize(600,525)
else:
detailsButton.set_label('Show Details')
detailsCtrlWindow.hide()
self.window.resize(self.defaultSize[0],self.defaultSize[1])
#treeview, iter, path, user_data
def onResponseSelected(self,widget):
scoreCtrl = self.builder.get_object("riskScoreCtrl")
treeselection = scoreCtrl.get_selection()
(model, iter) = treeselection.get_selected()
detailsBuf = self.detailsDict[model.get_value(iter, 0)]
self.decorator.updateMLTextCtrl("riskDetailsCtrl",detailsBuf)
def show(self):
self.window.show()
示例6: __init__
# 需要导入模块: from NDImplementationDecorator import NDImplementationDecorator [as 别名]
# 或者: from NDImplementationDecorator.NDImplementationDecorator import updateListCtrl [as 别名]
class AssetNodeDialog:
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)
def on_assetOkButton_clicked(self,callback_data):
self.window.destroy()
def show(self):
self.window.show()
示例7: __init__
# 需要导入模块: from NDImplementationDecorator import NDImplementationDecorator [as 别名]
# 或者: from NDImplementationDecorator.NDImplementationDecorator import updateListCtrl [as 别名]
class VulnerabilityNodeDialog:
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)
def on_vulnerabilityOkButton_clicked(self,callback_data):
self.window.destroy()
def show(self):
self.window.show()
示例8: __init__
# 需要导入模块: from NDImplementationDecorator import NDImplementationDecorator [as 别名]
# 或者: from NDImplementationDecorator.NDImplementationDecorator import updateListCtrl [as 别名]
class TransferNodeDialog:
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)
def on_transferOkButton_clicked(self,callback_data):
self.window.destroy()
def show(self):
self.window.show()
示例9: __init__
# 需要导入模块: from NDImplementationDecorator import NDImplementationDecorator [as 别名]
# 或者: from NDImplementationDecorator.NDImplementationDecorator import updateListCtrl [as 别名]
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()
示例10: __init__
# 需要导入模块: from NDImplementationDecorator import NDImplementationDecorator [as 别名]
# 或者: from NDImplementationDecorator.NDImplementationDecorator import updateListCtrl [as 别名]
class ThreatNodeDialog:
def __init__(self,objt,environmentName,dupProperty,overridingEnvironment,builder):
self.window = builder.get_object("ThreatNodeDialog")
self.decorator = NDImplementationDecorator(builder)
self.decorator.updateTextCtrl("threatNameCtrl",objt.name())
self.decorator.updateTextCtrl("threatTypeCtrl",objt.type())
self.decorator.updateTextCtrl("threatLikelihoodCtrl",objt.likelihood(environmentName,dupProperty,overridingEnvironment))
self.decorator.updateMLTextCtrl("threatMethodCtrl",objt.method())
attackers = []
for attacker in objt.attackers(environmentName,dupProperty):
attackers.append([attacker])
self.decorator.updateListCtrl("threatAttackersCtrl",['Attacker'],gtk.ListStore(str),attackers)
assets = []
for asset in objt.assets(environmentName,dupProperty):
assets.append([asset])
self.decorator.updateListCtrl("threatAssetsCtrl",['Asset'],gtk.ListStore(str),assets)
self.decorator.updateListCtrl("threatPropertiesCtrl",['Property','Value'],gtk.ListStore(str,str),objt.propertyList(environmentName,dupProperty,overridingEnvironment))
self.window.resize(350,350)
def on_threatOkButton_clicked(self,callback_data):
self.window.destroy()
def show(self):
self.window.show()
示例11: __init__
# 需要导入模块: from NDImplementationDecorator import NDImplementationDecorator [as 别名]
# 或者: from NDImplementationDecorator.NDImplementationDecorator import updateListCtrl [as 别名]
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()
示例12: __init__
# 需要导入模块: from NDImplementationDecorator import NDImplementationDecorator [as 别名]
# 或者: from NDImplementationDecorator.NDImplementationDecorator import updateListCtrl [as 别名]
class CountermeasureNodeDialog:
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)
def on_countermeasureOkButton_clicked(self,callback_data):
self.window.destroy()
def show(self):
self.window.show()
示例13: __init__
# 需要导入模块: from NDImplementationDecorator import NDImplementationDecorator [as 别名]
# 或者: from NDImplementationDecorator.NDImplementationDecorator import updateListCtrl [as 别名]
class RoleNodeDialog:
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)
def on_roleOkButton_clicked(self,callback_data):
self.window.destroy()
def show(self):
self.window.show()
示例14: __init__
# 需要导入模块: from NDImplementationDecorator import NDImplementationDecorator [as 别名]
# 或者: from NDImplementationDecorator.NDImplementationDecorator import updateListCtrl [as 别名]
class UseCaseNodeDialog:
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)
def on_usecaseOkButton_clicked(self,callback_data):
self.window.destroy()
def on_usecaseStepsCtrl_row_activated(self,widget,idx,callback_data):
stepNo = idx[0]
print 'move_cursor:',widget,' ',stepNo
stepExceptions = (self.theSteps[stepNo]).exceptions()
excs = []
for e in stepExceptions:
excs.append([e])
self.decorator.updateListCtrl("usecaseExceptionCtrl",['Exception'],gtk.ListStore(str),excs)
def show(self):
self.window.show()