MCPcopy Create free account
hub / github.com/CloverHackyColor/CloverBootloader / CreateXml

Function CreateXml

BaseTools/Source/Python/UPT/Xml/IniToXml.py:475–495  ·  view source on GitHub ↗
(DistMap, ToolsMap, MiscMap, IniFile)

Source from the content-addressed store, hash-verified

473# @param IniFile: Ini File
474#
475def CreateXml(DistMap, ToolsMap, MiscMap, IniFile):
476 Attrs = [['xmlns', 'http://www.uefi.org/2011/1.1'],
477 ['xmlns:xsi', 'http:/www.w3.org/2001/XMLSchema-instance'],
478 ]
479 Root = CreateXmlElement('DistributionPackage', '', [], Attrs)
480 CreateHeaderXml(DistMap, Root)
481 CreateToolsXml(ToolsMap, Root, 'Tools')
482 CreateToolsXml(MiscMap, Root, 'MiscellaneousFiles')
483
484 FileAndExt = IniFile.rsplit('.', 1)
485 if len(FileAndExt) > 1:
486 FileName = FileAndExt[0] + '.xml'
487 else:
488 FileName = IniFile + '.xml'
489 File = open(FileName, 'w')
490
491 try:
492 File.write(Root.toprettyxml(indent = ' '))
493 finally:
494 File.close()
495 return FileName
496

Callers 1

IniToXmlFunction · 0.85

Calls 5

CreateXmlElementFunction · 0.90
CreateHeaderXmlFunction · 0.85
CreateToolsXmlFunction · 0.85
lenFunction · 0.85
closeMethod · 0.45

Tested by

no test coverage detected