MCPcopy Index your code
hub / github.com/aboutcode-org/vulnerablecode / setSchemaVersion

Method setSchemaVersion

vulnerabilities/lib_oval.py:617–633  ·  view source on GitHub ↗

Sets a value for the schema_version element. If that element does not exist, one will be created.

(self, version)

Source from the content-addressed store, hash-verified

615 return None
616
617 def setSchemaVersion(self, version):
618 """
619 Sets a value for the schema_version element. If that element does not exist, one will be created.
620 """
621 if self.element is None:
622 return False
623
624 if version is None:
625 return False
626
627 child = self.element.find("oval:schema_version", OvalDocument.NS_OVAL)
628 if child is not None:
629 child.text = version
630 else:
631 child = Element("{" + OvalDocument.NS_DEFAULT.get("def") + "}schema_version")
632 child.text = version
633 self.element.append(child)
634
635 def getTimestamp(self):
636 """

Callers 2

__init__Method · 0.95
getGeneratorMethod · 0.95

Calls 1

getMethod · 0.45

Tested by

no test coverage detected