Example #1
0
    def ObjectFactory(self, SupArchList, Type, Usage, Str):
        Object = HobObject()
        HelpStr = Str

        Object.SetHobType(Type)
        Object.SetUsage(Usage)
        Object.SetSupArchList(SupArchList)

        HelpTextObj = TextObject()
        HelpTextObj.SetLang('')
        HelpTextObj.SetString(HelpStr)
        Object.SetHelpTextList([HelpTextObj])

        return Object
Example #2
0
 def _GenSpecialComments(self):
     SpecialCommentsList = self.Parser.InfSpecialCommentSection.GetSpecialComments(
     )
     for Key in SpecialCommentsList:
         if Key == DT.TYPE_HOB_SECTION:
             HobList = []
             for Item in SpecialCommentsList[Key]:
                 Hob = HobObject()
                 Hob.SetHobType(Item.GetHobType())
                 Hob.SetUsage(Item.GetUsage())
                 Hob.SetSupArchList(Item.GetSupArchList())
                 if Item.GetHelpString():
                     HelpTextObj = CommonObject.TextObject()
                     if self.UniFileClassObject:
                         HelpTextObj.SetLang(DT.TAB_LANGUAGE_EN_X)
                     HelpTextObj.SetString(Item.GetHelpString())
                     Hob.SetHelpTextList([HelpTextObj])
                 HobList.append(Hob)
             self.SetHobList(HobList)
         elif Key == DT.TYPE_EVENT_SECTION:
             EventList = []
             for Item in SpecialCommentsList[Key]:
                 Event = EventObject()
                 Event.SetEventType(Item.GetEventType())
                 Event.SetUsage(Item.GetUsage())
                 if Item.GetHelpString():
                     HelpTextObj = CommonObject.TextObject()
                     if self.UniFileClassObject:
                         HelpTextObj.SetLang(DT.TAB_LANGUAGE_EN_X)
                     HelpTextObj.SetString(Item.GetHelpString())
                     Event.SetHelpTextList([HelpTextObj])
                 EventList.append(Event)
             self.SetEventList(EventList)
         elif Key == DT.TYPE_BOOTMODE_SECTION:
             BootModeList = []
             for Item in SpecialCommentsList[Key]:
                 BootMode = BootModeObject()
                 BootMode.SetSupportedBootModes(
                     Item.GetSupportedBootModes())
                 BootMode.SetUsage(Item.GetUsage())
                 if Item.GetHelpString():
                     HelpTextObj = CommonObject.TextObject()
                     if self.UniFileClassObject:
                         HelpTextObj.SetLang(DT.TAB_LANGUAGE_EN_X)
                     HelpTextObj.SetString(Item.GetHelpString())
                     BootMode.SetHelpTextList([HelpTextObj])
                 BootModeList.append(BootMode)
             self.SetBootModeList(BootModeList)
Example #3
0
    def FromXml(self, Item, Key):
        self.HobType = XmlAttribute(XmlNode(Item, '%s' % Key), 'HobType')
        self.Name = XmlElement(Item, '%s' % Key)
        self.CommonDefines.FromXml(Item, Key)
        for HelpTextItem in XmlList(Item, '%s/HelpText' % Key):
            HelpTextObj = HelpTextXml()
            HelpTextObj.FromXml(HelpTextItem, '%s/HelpText' % Key)
            self.HelpText.append(HelpTextObj)

        Hob = HobObject()
        Hob.SetHobType(self.HobType)
        Hob.SetSupArchList(self.CommonDefines.SupArchList)
        Hob.SetUsage(self.CommonDefines.Usage)
        Hob.SetHelpTextList(GetHelpTextList(self.HelpText))

        return Hob