def FromXml(self, Item, Key): self.EventType = XmlAttribute(XmlNode(Item, '%s' % Key), 'EventType') 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) Event = EventObject() Event.SetEventType(self.EventType) Event.SetUsage(self.CommonDefines.Usage) Event.SetHelpTextList(GetHelpTextList(self.HelpText)) return Event
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)