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

Method export

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

Source from the content-addressed store, hash-verified

239 else:
240 return False
241 def export(self, lwrite, level, nsmap, namespace_=XML_NS, name_='MalwareInstanceType', namespacedef_='', pretty_print=True):
242 if pretty_print:
243 eol_ = '\n'
244 else:
245 eol_ = ''
246 showIndent(lwrite, level, pretty_print)
247 lwrite('<%s:%s%s' % (nsmap[namespace_], name_, namespacedef_ and ' ' + namespacedef_ or '', ))
248 already_processed = set()
249 self.exportAttributes(lwrite, level, already_processed, namespace_, name_='MalwareInstanceType')
250 if self.hasContent_():
251 lwrite('>%s' % (eol_, ))
252 self.exportChildren(lwrite, level + 1, nsmap, XML_NS, name_, pretty_print=pretty_print)
253 showIndent(lwrite, level, pretty_print)
254 lwrite('</%s:%s>%s' % (nsmap[namespace_], name_, eol_))
255 else:
256 lwrite('/>%s' % (eol_, ))
257 def exportAttributes(self, lwrite, level, already_processed, namespace_='ttp:', name_='MalwareInstanceType'):
258 if self.idref is not None and 'idref' not in already_processed:
259 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