def ObjectFactory(self, CName, FFE, Usage, Notify, HelpStr, IsProtocol): if IsProtocol: Object = ProtocolObject() else: Object = PpiObject() Object.SetCName(CName) Object.SetFeatureFlag(FFE) Object.SetUsage(Usage) Object.SetNotify(Notify) HelpTextObj = TextObject() HelpTextObj.SetLang('') HelpTextObj.SetString(HelpStr) Object.SetHelpTextList([HelpTextObj]) return Object
def FromXml(self, Item, Key): self.UiName = XmlAttribute(XmlNode(Item, '%s' % Key), 'UiName') self.GuidType = XmlAttribute(XmlNode(Item, '%s' % Key), 'GuidType') self.Notify = XmlAttribute(XmlNode(Item, '%s' % Key), 'Notify') self.CName = XmlElement(Item, '%s/CName' % Key) self.GuidValue = XmlElement(Item, '%s/GuidValue' % Key) self.VariableName = XmlElement(Item, '%s/VariableName' % 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) if self.Type == 'Guid': GuidProtocolPpi = GuidObject() elif self.Type == 'Protocol': GuidProtocolPpi = ProtocolObject() else: GuidProtocolPpi = PpiObject() GuidProtocolPpi.SetHelpTextList(GetHelpTextList(self.HelpText)) return GuidProtocolPpi
def CreatePpiObject(): return PpiObject()