(DistMap, ToolsMap, MiscMap, IniFile)
| 473 | # @param IniFile: Ini File |
| 474 | # |
| 475 | def 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 |
no test coverage detected