Example #1
0
    def FromXml3(self, Item, Key):
        self.PcdItemType = \
        XmlAttribute(XmlNode(Item, '%s' % Key), 'PcdItemType')
        self.PcdUsage = XmlAttribute(XmlNode(Item, '%s' % Key), 'PcdUsage')
        self.TokenSpaceGuidCName = \
        XmlElement(Item, '%s/TokenSpaceGuidCName' % Key)
        self.CName = XmlElement(Item, '%s/CName' % Key)
        self.DefaultValue = XmlElement(Item, '%s/DefaultValue' % Key)
        self.CommonDefines.FromXml(XmlNode(Item, '%s' % Key), Key)
        for HelpTextItem in XmlList(Item, '%s/HelpText' % Key):
            HelpTextObj = HelpTextXml()
            HelpTextObj.FromXml(HelpTextItem, '%s/HelpText' % Key)
            self.HelpText.append(HelpTextObj)
        for PcdErrorItem in XmlList(Item, '%s/PcdError' % Key):
            PcdErrorObj = PcdErrorXml()
            PcdErrorObj.FromXml(PcdErrorItem, 'PcdError')
            self.PcdError.append(PcdErrorObj)

        self.DefaultValue = ConvertNOTEQToNE(self.DefaultValue)

        PcdEntry = PcdObject()
        PcdEntry.SetSupArchList(self.CommonDefines.SupArchList)
        PcdEntry.SetTokenSpaceGuidCName(self.TokenSpaceGuidCName)
        PcdEntry.SetCName(self.CName)
        PcdEntry.SetValidUsage(self.PcdUsage)
        PcdEntry.SetDefaultValue(self.DefaultValue)
        PcdEntry.SetFeatureFlag(
            ConvertNOTEQToNE(self.CommonDefines.FeatureFlag))
        PcdEntry.SetItemType(self.PcdItemType)

        PcdEntry.SetHelpTextList(GetHelpTextList(self.HelpText))
        PcdEntry.SetPcdErrorsList(self.PcdError)

        return PcdEntry
Example #2
0
    def FromXml(self, Item, Key):
        self.PcdItemType = \
        XmlAttribute(XmlNode(Item, '%s' % Key), 'PcdItemType')
        self.PcdUsage = XmlAttribute(XmlNode(Item, '%s' % Key), 'PcdUsage')
        self.TokenSpaceGuidCName = \
        XmlElement(Item, '%s/TokenSpaceGuidCname' % Key)
        self.TokenSpaceGuidValue = \
        XmlElement(Item, '%s/TokenSpaceGuidValue' % Key)
        self.Token = XmlElement(Item, '%s/Token' % Key)
        self.CName = XmlElement(Item, '%s/CName' % Key)
        self.PcdCName = XmlElement(Item, '%s/PcdCName' % Key)
        self.DatumType = XmlElement(Item, '%s/DatumType' % Key)
        self.ValidUsage = XmlElement(Item, '%s/ValidUsage' % Key)
        if not GlobalData.gIS_BINARY_INF:
            self.DefaultValue = XmlElement(Item, '%s/DefaultValue' % Key)
        else:
            self.DefaultValue = XmlElement(Item, '%s/Value' % Key)
        self.MaxDatumSize = XmlElement(Item, '%s/MaxDatumSize' % Key)
        self.Value = XmlElement(Item, '%s/Value' % Key)
        self.Offset = XmlElement(Item, '%s/Offset' % Key)
        self.CommonDefines.FromXml(XmlNode(Item, '%s' % Key), Key)

        for HelpTextItem in XmlList(Item, '%s/HelpText' % Key):
            HelpTextObj = HelpTextXml()
            HelpTextObj.FromXml(HelpTextItem, '%s/HelpText' % Key)
            self.HelpText.append(HelpTextObj)
        for PcdErrorItem in XmlList(Item, '%s/PcdError' % Key):
            PcdErrorObjXml = PcdErrorXml()
            PcdErrorObj = PcdErrorObjXml.FromXml(PcdErrorItem, 'PcdError')
            self.PcdError.append(PcdErrorObj)

        self.DefaultValue = ConvertNOTEQToNE(self.DefaultValue)

        PcdEntry = PcdObject()
        PcdEntry.SetSupArchList(self.CommonDefines.SupArchList)
        PcdEntry.SetTokenSpaceGuidCName(self.TokenSpaceGuidCName)
        PcdEntry.SetTokenSpaceGuidValue(self.TokenSpaceGuidValue)
        PcdEntry.SetToken(self.Token)
        PcdEntry.SetOffset(self.Offset)
        PcdEntry.SetCName(self.CName)
        PcdEntry.SetPcdCName(self.PcdCName)
        PcdEntry.SetDatumType(self.DatumType)
        PcdEntry.SetValidUsage(self.ValidUsage)
        PcdEntry.SetDefaultValue(self.DefaultValue)
        PcdEntry.SetMaxDatumSize(self.MaxDatumSize)
        PcdEntry.SetFeatureFlag(
            ConvertNOTEQToNE(self.CommonDefines.FeatureFlag))
        PcdEntry.SetItemType(self.PcdItemType)

        PcdEntry.SetHelpTextList(GetHelpTextList(self.HelpText))
        PcdEntry.SetPcdErrorsList(self.PcdError)

        return PcdEntry
Example #3
0
    def FromXml(self, Item, Key):
        if Key:
            pass
        if self.UserExtensionBinary:
            pass
        Dict = {}
        for SubItem in XmlList(Item, 'Binaries/Binary'):
            FileName = XmlElement(SubItem, 'Binary/FileName')
            FileType = XmlElement(SubItem, 'Binary/FileType')
            FFE = XmlElement(SubItem, 'Binary/FeatureFlag')
            SupArch = XmlElement(SubItem, 'Binary/SupArchList')
            DictKey = (FileName, FileType, ConvertNOTEQToNE(FFE), SupArch)
            ValueList = []
            for ValueNodeItem in XmlList(SubItem, \
                                         'Binary/BinaryFileOtherAttr'):
                Target = XmlElement(ValueNodeItem, \
                                    'BinaryFileOtherAttr/Target')
                Family = XmlElement(ValueNodeItem, \
                                    'BinaryFileOtherAttr/Family')
                TagName = XmlElement(ValueNodeItem, \
                                     'BinaryFileOtherAttr/TagName')
                Comment = XmlElement(ValueNodeItem, \
                                     'BinaryFileOtherAttr/Comment')
                if (Target == ' ') and (Family == ' ') and \
                   (TagName == ' ') and (Comment == ' '):
                    Target = ''
                    Family = ''
                    TagName = ''
                    Comment = ''

                ValueList.append((Target, Family, TagName, Comment))
            Dict[DictKey] = ValueList
        return Dict
Example #4
0
 def FromXml(self, Item, Key):
     if Key:
         pass
     self.Usage = XmlAttribute(Item, 'Usage')
     self.SupArchList = \
     [Arch for Arch in GetSplitValueList(XmlAttribute(Item, 'SupArchList'), DataType.TAB_SPACE_SPLIT) if Arch]
     self.SupModList = \
     [Mod for Mod in GetSplitValueList(XmlAttribute(Item, 'SupModList'), DataType.TAB_SPACE_SPLIT) if Mod]
     self.FeatureFlag = ConvertNOTEQToNE(XmlAttribute(Item, 'FeatureFlag'))
Example #5
0
    def FromXml2(self, Item, Key):
        self.TokenSpaceGuidCName = \
        XmlElement(Item, '%s/TokenSpaceGuidCname' % Key)
        self.Token = XmlElement(Item, '%s/Token' % Key)
        self.CName = XmlElement(Item, '%s/CName' % Key)
        self.DatumType = XmlElement(Item, '%s/DatumType' % Key)
        self.ValidUsage = XmlElement(Item, '%s/ValidUsage' % Key)
        self.DefaultValue = XmlElement(Item, '%s/DefaultValue' % Key)
        self.MaxDatumSize = XmlElement(Item, '%s/MaxDatumSize' % Key)
        self.CommonDefines.FromXml(XmlNode(Item, '%s' % Key), Key)
        for PromptItem in XmlList(Item, '%s/Prompt' % Key):
            PromptObj = PromptXml()
            PromptObj.FromXml(PromptItem, '%s/Prompt' % Key)
            self.Prompt.append(PromptObj)
        for HelpTextItem in XmlList(Item, '%s/HelpText' % Key):
            HelpTextObj = HelpTextXml()
            HelpTextObj.FromXml(HelpTextItem, '%s/HelpText' % Key)
            self.HelpText.append(HelpTextObj)
        for PcdErrorItem in XmlList(Item, '%s/PcdError' % Key):
            PcdErrorObjXml = PcdErrorXml()
            PcdErrorObj = PcdErrorObjXml.FromXml(PcdErrorItem, 'PcdError')
            self.PcdError.append(PcdErrorObj)

        self.DefaultValue = ConvertNOTEQToNE(self.DefaultValue)

        PcdEntry = PcdObject()
        PcdEntry.SetSupArchList(self.CommonDefines.SupArchList)
        PcdEntry.SetSupModuleList(self.CommonDefines.SupModList)
        PcdEntry.SetTokenSpaceGuidCName(self.TokenSpaceGuidCName)
        PcdEntry.SetToken(self.Token)
        PcdEntry.SetCName(self.CName)
        PcdEntry.SetDatumType(self.DatumType)
        PcdEntry.SetValidUsage(self.ValidUsage)
        PcdEntry.SetDefaultValue(self.DefaultValue)
        PcdEntry.SetMaxDatumSize(self.MaxDatumSize)
        PcdEntry.SetFeatureFlag(
            ConvertNOTEQToNE(self.CommonDefines.FeatureFlag))

        PcdEntry.SetPromptList(GetPromptList(self.Prompt))
        PcdEntry.SetHelpTextList(GetHelpTextList(self.HelpText))
        PcdEntry.SetPcdErrorsList(self.PcdError)

        return PcdEntry
Example #6
0
    def FromXml(self, Item, Key):
        self.ToolChainFamily = XmlAttribute(Item, 'Family')
        self.SourceFile = XmlElement(Item, 'Filename')
        self.CommonDefines.FromXml(Item, Key)

        self.CommonDefines.FeatureFlag = ConvertNOTEQToNE(self.CommonDefines.FeatureFlag)

        SourceFile = SourceFileObject()
        SourceFile.SetSourceFile(self.SourceFile)
        SourceFile.SetFamily(self.ToolChainFamily)
        SourceFile.SetSupArchList(self.CommonDefines.SupArchList)
        SourceFile.SetFeatureFlag(self.CommonDefines.FeatureFlag)

        return SourceFile
Example #7
0
    def FromXml(self, Item, Key):
        self.Description = XmlElement(Item, '%s/Description' % Key)
        self.Guid = XmlElement(Item, '%s/GUID' % Key)
        self.Version = XmlAttribute(XmlNode(Item, '%s/GUID' % Key), 'Version')
        self.CommonDefines.FromXml(XmlNode(Item, '%s' % Key), Key)

        PackageDependency = PackageDependencyObject()
        PackageDependency.SetPackage(self.Description)
        PackageDependency.SetGuid(self.Guid)
        PackageDependency.SetVersion(self.Version)
        PackageDependency.SetFeatureFlag(ConvertNOTEQToNE(self.CommonDefines.FeatureFlag))
        PackageDependency.SetSupArchList(self.CommonDefines.SupArchList)

        return PackageDependency
Example #8
0
    def FromXml(self, Item, Key):         
        GuidProtocolPpi = GuidProtocolPpiXml.FromXml(self, Item, Key)

        if self.Mode == 'Package':
            
            GuidProtocolPpi.SetSupArchList(self.CommonDefines.SupArchList)
            GuidProtocolPpi.SetSupModuleList(self.CommonDefines.SupModList)
            GuidProtocolPpi.SetCName(self.CName)
            GuidProtocolPpi.SetGuid(self.GuidValue)
        else:
            GuidProtocolPpi.SetUsage(self.CommonDefines.Usage)
            if self.GuidType:
                GuidProtocolPpi.SetGuidTypeList([self.GuidType])
            GuidProtocolPpi.SetSupArchList(self.CommonDefines.SupArchList)
            GuidProtocolPpi.SetFeatureFlag(ConvertNOTEQToNE(self.CommonDefines.FeatureFlag))
            GuidProtocolPpi.SetCName(self.CName)
            GuidProtocolPpi.SetVariableName(self.VariableName)
        return GuidProtocolPpi
Example #9
0
    def FromXml(self, Item, Key):
        self.FileType = XmlAttribute(Item, 'FileType')
        self.Filename = XmlElement(Item, 'Filename')
        self.CommonDefines.FromXml(Item, Key)

        FeatureFlag = ConvertNOTEQToNE(self.CommonDefines.FeatureFlag)

        Filename = FileNameObject()
        #
        # Convert File Type
        #
        if self.FileType == 'UEFI_IMAGE':
            self.FileType = 'PE32'

        Filename.SetFileType(self.FileType)
        Filename.SetFilename(self.Filename)
        Filename.SetSupArchList(self.CommonDefines.SupArchList)
        Filename.SetFeatureFlag(FeatureFlag)

        return Filename
Example #10
0
    def FromXml(self, Item, Key):
        GuidProtocolPpi = GuidProtocolPpiXml.FromXml(self, Item, Key)
        if self.Mode == 'Package':
            GuidProtocolPpi.SetSupArchList(self.CommonDefines.SupArchList)
            GuidProtocolPpi.SetSupModuleList(self.CommonDefines.SupModList)
            GuidProtocolPpi.SetCName(self.CName)
            GuidProtocolPpi.SetGuid(self.GuidValue)
        else:
            GuidProtocolPpi.SetUsage(self.CommonDefines.Usage)
            if self.Notify.upper() == "TRUE":
                GuidProtocolPpi.SetNotify(True)
            elif self.Notify.upper() == "FALSE":
                GuidProtocolPpi.SetNotify(False)
            else:
                GuidProtocolPpi.SetNotify('')
            GuidProtocolPpi.SetSupArchList(self.CommonDefines.SupArchList)
            GuidProtocolPpi.SetFeatureFlag(ConvertNOTEQToNE(self.CommonDefines.FeatureFlag))
            GuidProtocolPpi.SetCName(self.CName)
 
        return GuidProtocolPpi
Example #11
0
 def FromXml(self, Item, Key):
     self.Keyword = XmlAttribute(XmlNode(Item, '%s' % Key), 'Keyword')
     if self.Keyword == '':
         self.Keyword = XmlElement(Item, '%s/Keyword' % Key)
     self.HeaderFile = XmlElement(Item, '%s/HeaderFile' % Key)
     self.CommonDefines.FromXml(XmlNode(Item, '%s' % Key), Key)
     for HelpTextItem in XmlList(Item, '%s/HelpText' % Key):
         HelpTextObj = HelpTextXml()
         HelpTextObj.FromXml(HelpTextItem, '%s/HelpText' % Key)
         self.HelpText.append(HelpTextObj)
     LibraryClass = LibraryClassObject()
     LibraryClass.SetLibraryClass(self.Keyword)
     LibraryClass.SetIncludeHeader(self.HeaderFile)
     if self.CommonDefines.Usage:
         LibraryClass.SetUsage(self.CommonDefines.Usage)
     LibraryClass.SetSupArchList(self.CommonDefines.SupArchList)
     LibraryClass.SetSupModuleList(self.CommonDefines.SupModList)
     LibraryClass.SetFeatureFlag(ConvertNOTEQToNE(self.CommonDefines.FeatureFlag))
     LibraryClass.SetHelpTextList(GetHelpTextList(self.HelpText))
     return LibraryClass