Beispiel #1
0
    def FromXml(self, Item, Key):
        self.SupportedBootModes = \
        XmlElement(Item, '%s/SupportedBootModes' % 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)

        BootMode = BootModeObject()
        BootMode.SetSupportedBootModes(self.SupportedBootModes)
        BootMode.SetUsage(self.CommonDefines.Usage)
        BootMode.SetHelpTextList(GetHelpTextList(self.HelpText))

        return BootMode
Beispiel #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)