MCPcopy Create free account
hub / github.com/STIXProject/python-stix / exportChildren

Method exportChildren

stix/bindings/ttp.py:1383–1417  ·  view source on GitHub ↗
(self, lwrite, level, nsmap, namespace_=XML_NS, name_='TTPType', fromsubclass_=False, pretty_print=True)

Source from the content-addressed store, hash-verified

1381 already_processed.add('version')
1382 lwrite(' version=%s' % (quote_attrib(self.version), ))
1383 def exportChildren(self, lwrite, level, nsmap, namespace_=XML_NS, name_='TTPType', fromsubclass_=False, pretty_print=True):
1384 super(TTPType, self).exportChildren(lwrite, level, nsmap, namespace_, name_, True, pretty_print=pretty_print)
1385 if pretty_print:
1386 eol_ = '\n'
1387 else:
1388 eol_ = ''
1389 if self.Title is not None:
1390 showIndent(lwrite, level, pretty_print)
1391 lwrite('<%s:Title>%s</%s:Title>%s' % (nsmap[namespace_], quote_xml(self.Title), nsmap[namespace_], eol_))
1392 for Description in self.Description:
1393 Description.export(lwrite, level, nsmap, namespace_, name_='Description', pretty_print=pretty_print)
1394 for Short_Description in self.Short_Description:
1395 Short_Description.export(lwrite, level, nsmap, namespace_, name_='Short_Description', pretty_print=pretty_print)
1396 for Intended_Effect_ in self.Intended_Effect:
1397 Intended_Effect_.export(lwrite, level, nsmap, namespace_, name_='Intended_Effect', pretty_print=pretty_print)
1398 if self.Behavior is not None:
1399 self.Behavior.export(lwrite, level, nsmap, namespace_, name_='Behavior', pretty_print=pretty_print)
1400 if self.Resources is not None:
1401 self.Resources.export(lwrite, level, nsmap, namespace_, name_='Resources', pretty_print=pretty_print)
1402 if self.Victim_Targeting is not None:
1403 self.Victim_Targeting.export(lwrite, level, nsmap, namespace_, name_='Victim_Targeting', pretty_print=pretty_print)
1404 if self.Exploit_Targets is not None:
1405 self.Exploit_Targets.export(lwrite, level, nsmap, namespace_, name_='Exploit_Targets', pretty_print=pretty_print)
1406 if self.Related_TTPs is not None:
1407 self.Related_TTPs.export(lwrite, level, nsmap, namespace_, name_='Related_TTPs', pretty_print=pretty_print)
1408 if self.Kill_Chain_Phases is not None:
1409 self.Kill_Chain_Phases.export(lwrite, level, nsmap, namespace_, name_='Kill_Chain_Phases', pretty_print=pretty_print)
1410 if self.Information_Source is not None:
1411 self.Information_Source.export(lwrite, level, nsmap, namespace_, name_='Information_Source', pretty_print=pretty_print)
1412 if self.Kill_Chains is not None:
1413 self.Kill_Chains.export(lwrite, level, nsmap, namespace_, name_='Kill_Chains', pretty_print=pretty_print)
1414 if self.Handling is not None:
1415 self.Handling.export(lwrite, level, nsmap, namespace_, name_='Handling', pretty_print=pretty_print)
1416 if self.Related_Packages is not None:
1417 self.Related_Packages.export(lwrite, level, nsmap, namespace_, name_='Related_Packages', pretty_print=pretty_print)
1418 def build(self, node):
1419 self.__sourcenode__ = node
1420 already_processed = set()

Callers 3

exportMethod · 0.95
exportChildrenMethod · 0.45
exportChildrenMethod · 0.45

Calls 1

exportMethod · 0.45

Tested by

no test coverage detected