Ejemplo n.º 1
0
    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
Ejemplo n.º 2
0
 def ToXml(self, Dict, Key):
     if self.UserExtensionBinary:
         pass
     BinariesNodeList = []
     for Item in Dict:
         ValueList = Dict[Item]
         (FileName, FileType, FeatureFlag, SupArch) = Item
         FileNodeList = []
         FileNodeList.append(["FileName", FileName])
         FileNodeList.append(["FileType", FileType])
         FileNodeList.append(["FeatureFlag", ConvertNEToNOTEQ(FeatureFlag)])
         FileNodeList.append(["SupArchList", SupArch])
         for (Target, Family, TagName, Comment) in ValueList:
             ValueNodeList = []
             if not (Target or Family or TagName or Comment):
                 Target = ' '
                 Family = ' '
                 TagName = ' '
                 Comment = ' '
             ValueNodeList.append(["Target", Target])
             ValueNodeList.append(["Family", Family])
             ValueNodeList.append(["TagName", TagName])
             ValueNodeList.append(["Comment", Comment])
             ValueNodeXml = CreateXmlElement('BinaryFileOtherAttr', '', \
                                             ValueNodeList, [])
             FileNodeList.append(ValueNodeXml)
         FileNodeXml = CreateXmlElement('Binary', '', FileNodeList, [])
         BinariesNodeList.append(FileNodeXml)
     Root = CreateXmlElement('%s' % Key, '', BinariesNodeList, [])
     return Root
Ejemplo n.º 3
0
 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
Ejemplo n.º 4
0
    def ToXml4(self, PcdEntry, Key):
        if self.PcdCName:
            pass

        DefaultValue = ConvertNEToNOTEQ(PcdEntry.GetDefaultValue())

        AttributeList = []

        NodeList = [['TokenSpaceGuidValue',
                     PcdEntry.GetTokenSpaceGuidValue()],
                    ['PcdCName', PcdEntry.GetCName()],
                    ['Token', PcdEntry.GetToken()],
                    ['DatumType', PcdEntry.GetDatumType()],
                    ['MaxDatumSize',
                     PcdEntry.GetMaxDatumSize()], ['Value', DefaultValue],
                    ['Offset', PcdEntry.GetOffset()]]

        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
Ejemplo n.º 5
0
 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
Ejemplo n.º 6
0
    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
Ejemplo n.º 7
0
    def ToXml(self, Filename, Key):
        if self.Filename:
            pass
        AttributeList = [['SupArchList', \
                          GetStringOfList(Filename.GetSupArchList())],
                         ['FileType', Filename.GetFileType()],
                         ['FeatureFlag', ConvertNEToNOTEQ(Filename.GetFeatureFlag())],
                        ]
        Root = CreateXmlElement('%s' % Key, Filename.GetFilename(), [], AttributeList)

        return Root
Ejemplo n.º 8
0
 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