def ToXml(self, BinaryFile, Key): if self.FileNames: pass NodeList = [] FilenameList = BinaryFile.GetFileNameList() SupportArch = None for Filename in FilenameList: Tmp = FilenameXml() NodeList.append(Tmp.ToXml(Filename, 'Filename')) SupportArch = Filename.SupArchList AsBuildList = BinaryFile.GetAsBuiltList() PatchPcdValueList = AsBuildList.GetPatchPcdList() PcdExList = AsBuildList.GetPcdExList() LibGuidVerList = AsBuildList.GetLibraryInstancesList() BuildFlagList = AsBuildList.GetBuildFlagsList() AsBuiltNodeList = [] for Pcd in PatchPcdValueList: if IsMatchArch(Pcd.SupArchList, SupportArch): Tmp = PcdEntryXml() AsBuiltNodeList.append(Tmp.ToXml4(Pcd, 'PatchPcdValue')) for Pcd in PcdExList: if IsMatchArch(Pcd.SupArchList, SupportArch): Tmp = PcdEntryXml() AsBuiltNodeList.append(Tmp.ToXml4(Pcd, 'PcdExValue')) GuiVerElemList = [] for LibGuidVer in LibGuidVerList: if LibGuidVer.GetLibGuid() and IsMatchArch( LibGuidVer.GetSupArchList(), SupportArch): GuiVerElem = \ CreateXmlElement('GUID', LibGuidVer.GetLibGuid(), [], [['Version', LibGuidVer.GetLibVersion()]]) GuiVerElemList.append(GuiVerElem) if len(GuiVerElemList) > 0: LibGuidVerElem = CreateXmlElement('LibraryInstances', '', GuiVerElemList, []) AsBuiltNodeList.append(LibGuidVerElem) for BuildFlag in BuildFlagList: if IsMatchArch(BuildFlag.GetSupArchList(), SupportArch): for Item in BuildFlag.GetAsBuildList(): Tmp = BuildFlagXml() Elem = CreateXmlElement('BuildFlags', ''.join(Item), [], []) AsBuiltNodeList.append(Elem) if len(AsBuiltNodeList) > 0: Element = CreateXmlElement('AsBuilt', '', AsBuiltNodeList, []) NodeList.append(Element) Root = CreateXmlElement('%s' % Key, '', NodeList, []) return Root
def ToXml(self, BinaryFile, Key): if self.FileNames: pass NodeList = [] FilenameList = BinaryFile.GetFileNameList() for Filename in FilenameList: Tmp = FilenameXml() NodeList.append(Tmp.ToXml(Filename, 'Filename')) if GlobalData.gIS_BINARY_INF: AsBuildList = BinaryFile.GetAsBuiltList() PatchPcdValueList = AsBuildList.GetPatchPcdList() PcdExList = AsBuildList.GetPcdExList() LibGuidVerList = AsBuildList.GetLibraryInstancesList() BuildFlagList = AsBuildList.GetBuildFlagsList() AsBuiltNodeList = [] for Pcd in PatchPcdValueList: Tmp = PcdEntryXml() AsBuiltNodeList.append(Tmp.ToXml4(Pcd, 'PatchPcdValue')) for Pcd in PcdExList: Tmp = PcdEntryXml() AsBuiltNodeList.append(Tmp.ToXml4(Pcd, 'PcdExValue')) GuiVerElemList = [] for LibGuidVer in LibGuidVerList: GuiVerElem = \ CreateXmlElement('GUID', LibGuidVer.GetLibGuid(), [], [['Version', LibGuidVer.GetLibVersion()]]) GuiVerElemList.append(GuiVerElem) if len(GuiVerElemList) > 0: LibGuidVerElem = CreateXmlElement('LibraryInstances', '', GuiVerElemList, []) AsBuiltNodeList.append(LibGuidVerElem) for BuildFlag in BuildFlagList: Tmp = BuildFlagXml() Elem = CreateXmlElement('BuildFlags', ''.join(BuildFlag), [], []) AsBuiltNodeList.append(Elem) if len(AsBuiltNodeList) > 0: Element = CreateXmlElement('AsBuilt', '', AsBuiltNodeList, []) NodeList.append(Element) Root = CreateXmlElement('%s' % Key, '', NodeList, []) return Root