def ToXml(self, GuidProtocolPpi, Key): if self.Mode == 'Package': AttributeList = \ [['SupArchList', \ GetStringOfList(GuidProtocolPpi.GetSupArchList())], ] NodeList = [ ['CName', GuidProtocolPpi.GetCName()], ['GuidValue', GuidProtocolPpi.GetGuid()], ] else: AttributeList = \ [['Usage', GetStringOfList(GuidProtocolPpi.GetUsage())], \ ['Notify', str(GuidProtocolPpi.GetNotify()).lower()], \ ['SupArchList', \ GetStringOfList(GuidProtocolPpi.GetSupArchList())], \ ['FeatureFlag', ConvertNEToNOTEQ(GuidProtocolPpi.GetFeatureFlag())] ] NodeList = [ ['CName', GuidProtocolPpi.GetCName()], ] for Item in GuidProtocolPpi.GetHelpTextList(): Tmp = HelpTextXml() NodeList.append(Tmp.ToXml(Item)) Root = CreateXmlElement('%s' % Key, '', NodeList, AttributeList) return Root
def ToXml(self, LibraryClass, Key): if self.HeaderFile: pass AttributeList = \ [['Keyword', LibraryClass.GetLibraryClass()], ['SupArchList', GetStringOfList(LibraryClass.GetSupArchList())], ['SupModList', GetStringOfList(LibraryClass.GetSupModuleList())] ] NodeList = [['HeaderFile', LibraryClass.GetIncludeHeader()]] for Item in LibraryClass.GetHelpTextList(): Tmp = HelpTextXml() NodeList.append(Tmp.ToXml(Item)) Root = CreateXmlElement('%s' % Key, '', NodeList, AttributeList) return Root
def ToXml2(self, LibraryClass, Key): if self.HeaderFile: pass FeatureFlag = ConvertNEToNOTEQ(LibraryClass.GetFeatureFlag()) AttributeList = \ [['Usage', LibraryClass.GetUsage()], \ ['SupArchList', GetStringOfList(LibraryClass.GetSupArchList())], \ ['SupModList', GetStringOfList(LibraryClass.GetSupModuleList())], \ ['FeatureFlag', FeatureFlag] ] NodeList = [['Keyword', LibraryClass.GetLibraryClass()], ] for Item in LibraryClass.GetHelpTextList(): Tmp = HelpTextXml() NodeList.append(Tmp.ToXml(Item)) Root = CreateXmlElement('%s' % Key, '', NodeList, AttributeList) return Root
def ToXml3(self, PcdEntry, Key): if self.PcdCName: pass DefaultValue = ConvertNEToNOTEQ(PcdEntry.GetDefaultValue()) AttributeList = \ [['SupArchList', GetStringOfList(PcdEntry.GetSupArchList())], \ ['PcdUsage', PcdEntry.GetValidUsage()], \ ['PcdItemType', PcdEntry.GetItemType()], \ ['FeatureFlag', ConvertNEToNOTEQ(PcdEntry.GetFeatureFlag())], ] NodeList = [ ['CName', PcdEntry.GetCName()], ['TokenSpaceGuidCName', PcdEntry.GetTokenSpaceGuidCName()], ['DefaultValue', DefaultValue], ] for Item in PcdEntry.GetHelpTextList(): Tmp = HelpTextXml() NodeList.append(Tmp.ToXml(Item)) for Item in PcdEntry.GetPcdErrorsList(): Tmp = PcdErrorXml() NodeList.append(Tmp.ToXml(Item, 'PcdError')) Root = CreateXmlElement('%s' % Key, '', NodeList, AttributeList) return Root
def ToXml(self, Header, BootModes, Events, Hobs, Key): if self.ModuleType: pass AttributeList = [ ['SupArchList', GetStringOfList(Header.GetSupArchList())], ] NodeList = [ ['ModuleType', Header.GetModuleType()], ['Path', Header.GetModulePath()], ['PcdIsDriver', Header.GetPcdIsDriver()], ['UefiSpecificationVersion', Header.GetUefiSpecificationVersion()], ['PiSpecificationVersion', Header.GetPiSpecificationVersion()], ] for Item in Header.GetSpecList(): Spec, Version = Item SpecElem = CreateXmlElement('Specification', Spec, [], [['Version', Version]]) NodeList.append(SpecElem) for Item in BootModes: Tmp = BootModeXml() NodeList.append(Tmp.ToXml(Item, 'BootMode')) for Item in Events: Tmp = EventXml() NodeList.append(Tmp.ToXml(Item, 'Event')) for Item in Hobs: Tmp = HobXml() NodeList.append(Tmp.ToXml(Item, 'HOB')) Root = CreateXmlElement('%s' % Key, '', NodeList, AttributeList) return Root
def ToXml(self, Filename, Key): if self.Filename: pass AttributeList = [['SupArchList', \ GetStringOfList(Filename.GetSupArchList())], ['FileType', Filename.GetFileType()], ['FeatureFlag', ConvertNEToNOTEQ(Filename.GetFeatureFlag())], ['GUID', Filename.GetGuidValue()] ] Root = CreateXmlElement('%s' % Key, Filename.GetFilename(), [], AttributeList) return Root
def ToXml(self, SourceFile, Key): if self.SourceFile: pass FeatureFlag = ConvertNEToNOTEQ(SourceFile.GetFeatureFlag()) AttributeList = [ ['SupArchList', GetStringOfList(SourceFile.GetSupArchList())], ['Family', SourceFile.GetFamily()], ['FeatureFlag', FeatureFlag], ] Root = CreateXmlElement('%s' % Key, SourceFile.GetSourceFile(), [], AttributeList) return Root
def ToXml(self, Depex, Key): if self.HelpText: pass AttributeList = [[ 'SupArchList', GetStringOfList(Depex.GetSupArchList()) ], ['SupModList', Depex.GetModuleType()]] NodeList = [['Expression', Depex.GetDepex()]] if Depex.GetHelpText(): Tmp = HelpTextXml() NodeList.append(Tmp.ToXml(Depex.GetHelpText(), 'HelpText')) Root = CreateXmlElement('%s' % Key, '', NodeList, AttributeList) return Root
def ToXml(self, Hob, Key): if self.Name: pass AttributeList = [ ['HobType', Hob.GetHobType()], ['Usage', Hob.GetUsage()], ['SupArchList', GetStringOfList(Hob.GetSupArchList())], ] NodeList = [] for Item in Hob.GetHelpTextList(): Tmp = HelpTextXml() NodeList.append(Tmp.ToXml(Item, 'HelpText')) Root = CreateXmlElement('%s' % Key, '', NodeList, AttributeList) return Root
def ToXml(self, PackageDependency, Key): if self.Guid: pass AttributeList = [ [ 'SupArchList', GetStringOfList(PackageDependency.GetSupArchList()) ], [ 'FeatureFlag', ConvertNEToNOTEQ(PackageDependency.GetFeatureFlag()) ], ] Element1 = CreateXmlElement( 'GUID', PackageDependency.GetGuid(), [], [['Version', PackageDependency.GetVersion()]]) NodeList = [ ['Description', PackageDependency.GetPackage()], Element1, ] Root = CreateXmlElement('%s' % Key, '', NodeList, AttributeList) return Root
def ToXml(self, UserExtension, Key): if self.UserId: pass AttributeList = [['UserId', str(UserExtension.GetUserID())], ['Identifier', str(UserExtension.GetIdentifier())], ['SupArchList', \ GetStringOfList(UserExtension.GetSupArchList())], ] Root = CreateXmlElement('%s' % Key, UserExtension.GetStatement(), [], \ AttributeList) if UserExtension.GetIdentifier() == DataType.TAB_BINARY_HEADER_IDENTIFIER and \ UserExtension.GetUserID() == DataType.TAB_BINARY_HEADER_USERID: for (Lang, Value) in UserExtension.GetBinaryAbstract(): if Value: ChildElement = CreateXmlElement('BinaryAbstract', Value, [], [['Lang', Lang]]) Root.appendChild(ChildElement) for (Lang, Value) in UserExtension.GetBinaryDescription(): if Value: ChildElement = CreateXmlElement('BinaryDescription', Value, [], [['Lang', Lang]]) Root.appendChild(ChildElement) for (Lang, Value) in UserExtension.GetBinaryCopyright(): if Value: ChildElement = CreateXmlElement('BinaryCopyright', Value, [], []) Root.appendChild(ChildElement) for (Lang, Value) in UserExtension.GetBinaryLicense(): if Value: ChildElement = CreateXmlElement('BinaryLicense', Value, [], []) Root.appendChild(ChildElement) NodeList = [] DefineDict = UserExtension.GetDefinesDict() if DefineDict: for Item in DefineDict.keys(): NodeList.append(CreateXmlElement\ ('Statement', Item, [], [])) DefineElement = CreateXmlElement('Define', '', NodeList, []) Root.appendChild(DefineElement) NodeList = [] BuildOptionDict = UserExtension.GetBuildOptionDict() if BuildOptionDict: for Item in BuildOptionDict.keys(): NodeList.append(CreateXmlElement\ ('Statement', BuildOptionDict[Item], [], \ [['SupArchList', Item]])) BuildOptionElement = \ CreateXmlElement('BuildOption', '', NodeList, []) Root.appendChild(BuildOptionElement) NodeList = [] IncludesDict = UserExtension.GetIncludesDict() if IncludesDict: for Item in IncludesDict.keys(): NodeList.append(CreateXmlElement\ ('Statement', Item, [], \ [['SupArchList', IncludesDict[Item]]])) IncludesElement = CreateXmlElement('Includes', '', NodeList, []) Root.appendChild(IncludesElement) NodeList = [] SourcesDict = UserExtension.GetSourcesDict() if SourcesDict: Tmp = UserExtensionSourceXml() Root.appendChild(Tmp.ToXml(SourcesDict, 'Sources')) NodeList = [] BinariesDict = UserExtension.GetBinariesDict() if BinariesDict: Tmp = UserExtensionBinaryXml() Root.appendChild(Tmp.ToXml(BinariesDict, 'Binaries')) return Root