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

Method export

stix/bindings/ttp.py:375–390  ·  view source on GitHub ↗
(self, lwrite, level, nsmap, namespace_=XML_NS, name_='ExploitType', namespacedef_='', pretty_print=True)

Source from the content-addressed store, hash-verified

373 else:
374 return False
375 def export(self, lwrite, level, nsmap, namespace_=XML_NS, name_='ExploitType', namespacedef_='', pretty_print=True):
376 if pretty_print:
377 eol_ = '\n'
378 else:
379 eol_ = ''
380 showIndent(lwrite, level, pretty_print)
381 lwrite('<%s:%s%s' % (nsmap[namespace_], name_, namespacedef_ and ' ' + namespacedef_ or '', ))
382 already_processed = set()
383 self.exportAttributes(lwrite, level, already_processed, namespace_, name_='ExploitType')
384 if self.hasContent_():
385 lwrite('>%s' % (eol_, ))
386 self.exportChildren(lwrite, level + 1, nsmap, XML_NS, name_, pretty_print=pretty_print)
387 showIndent(lwrite, level, pretty_print)
388 lwrite('</%s:%s>%s' % (nsmap[namespace_], name_, eol_))
389 else:
390 lwrite('/>%s' % (eol_, ))
391 def exportAttributes(self, lwrite, level, already_processed, namespace_='ttp:', name_='ExploitType'):
392 if self.idref is not None and 'idref' not in already_processed:
393 already_processed.add('idref')

Callers

nothing calls this directly

Calls 3

exportAttributesMethod · 0.95
hasContent_Method · 0.95
exportChildrenMethod · 0.95

Tested by

no test coverage detected