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

Method setProduct

vulnerabilities/lib_oval.py:586–602  ·  view source on GitHub ↗

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

(self, product)

Source from the content-addressed store, hash-verified

584 return self.element
585
586 def setProduct(self, product):
587 """
588 Sets a value for the product element. If a product element does not already exist, one will be created
589 """
590 if self.element is None:
591 return False
592
593 if product is None:
594 return False
595
596 child = self.element.find("oval:product_name", OvalDocument.NS_OVAL)
597 if child is not None:
598 child.text = product
599 else:
600 child = Element("{" + OvalDocument.NS_DEFAULT.get("def") + "}product_name")
601 child.text = product
602 self.element.append(child)
603
604 def getSchemaVersion(self):
605 """

Callers 2

__init__Method · 0.95
getGeneratorMethod · 0.95

Calls 1

getMethod · 0.45

Tested by

no test coverage detected