MCPcopy Create free account
hub / github.com/aboutcode-org/vulnerablecode / writeToFile

Method writeToFile

vulnerabilities/lib_oval.py:235–253  ·  view source on GitHub ↗

Writes the internal representation of the XmlTree to the given file name Returns False on error @rtype: boolean @return: True on success, otherwise False

(self, filename)

Source from the content-addressed store, hash-verified

233 return False
234
235 def writeToFile(self, filename):
236 """
237 Writes the internal representation of the XmlTree to the given file name
238 Returns False on error
239
240 @rtype: boolean
241 @return: True on success, otherwise False
242 """
243 try:
244 if not filename:
245 return False
246 if not self.tree:
247 return False
248
249 ### TODO: Add all necessary namespaces
250 self.tree.write(filename, "UTF-8", True, OvalDocument.NS_DEFAULT, "xml")
251
252 except Exception:
253 return False
254
255 def to_string(self):
256 if not self.tree:

Callers

nothing calls this directly

Calls 1

writeMethod · 0.80

Tested by

no test coverage detected