CommonXml.py revision 4fd606d1f5abe38e1f42c38de1d2e895166bd0f4
## @file
# This file is used to parse a PCD file of .PKG file
#
# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials are licensed and made available
# under the terms and conditions of the BSD License which accompanies this
# distribution. The full text of the license may be found at
#
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#
'''
CommonXml
'''
##
# Import Modules
#
##
# ClonedFromXml
#
class ClonedFromXml(object):
return None
return ClonedFrom
pass
AttributeList = []
return Root
##
# CommonDefinesXml
#
class CommonDefinesXml(object):
self.SupArchList = []
self.SupModList = []
if Key:
pass
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]
pass
return "Usage = %s SupArchList = %s SupModList = %s FeatureFlag = %s" \
##
# HelpTextXml
#
class HelpTextXml(object):
if Key:
pass
pass
##
# HeaderXml
#
if not Item and IsRequiredCheck:
XmlTreeLevel = []
else:
return ModuleHeader
pass
AttributeList = []
]
return Root
return "Name = %s BaseName = %s GUID = %s Version = %s Copyright = %s \
##
# DistributionPackageHeaderXml
#
class DistributionPackageHeaderXml(object):
if not Item:
return None
return DistributionPackageHeader
pass
DistributionPackageHeader.GetName(), [], \
[['BaseName', \
DistributionPackageHeader.GetGuid(), [], \
[['Version', \
AttributeList = []
['Description', \
['XmlSpecification', \
]
return Root
return "ReadOnly = %s RePackage = %s Vendor = %s Date = %s \
##
# PackageHeaderXml
#
class PackageHeaderXml(object):
if not Item:
CheckDict = {'PackageHeader':None, }
if self.PackagePath:
pass
Element1 = \
AttributeList = []
]
return Root
return "PackagePath = %s %s" \
##
# MiscellaneousFileXml
#
class MiscellaneousFileXml(object):
##
# This API is used for Package or Module's MiscellaneousFile section
#
if not Item:
return None
else:
MiscFileList = []
FileObj = FileObject()
return MiscFile
##
# This API is used for DistP's tool section
#
if Item is None:
return None
Executable = \
else:
MiscFileList = []
FileObj = FileObject()
return MiscFile
##
# This API is used for Package or Module's MiscellaneousFile section
#
pass
if MiscFile:
]
return Root
##
# This API is used for DistP's tool section
#
pass
if MiscFile:
]
NodeList = [HeaderNode]
return Root
return Str
##
# UserExtensionsXml
#
class UserExtensionsXml(object):
self.DefineDict = {}
self.BuildOptionDict = {}
self.IncludesDict = {}
self.SourcesDict = {}
self.BinariesDict = {}
self.SupArchList = []
return UserExtension
return UserExtension
pass
['SupArchList', \
]
NodeList = []
if DefineDict:
('Statement', Item, [], []))
NodeList = []
if BuildOptionDict:
[['SupArchList', Item]]))
NodeList = []
if IncludesDict:
('Statement', Item, [], \
NodeList = []
if SourcesDict:
NodeList = []
if BinariesDict:
return Root
return Str
##
# UserExtensionSourceXml
#
class UserExtensionSourceXml(object):
if Key:
pass
pass
Dict = {}
ValueList = []
TagName = ''
ToolCode = ''
Comment = ''
return Dict
pass
SourcesNodeList = []
SourceFileNodeList = []
ValueNodeList = []
TagName = ' '
ToolCode = ' '
Comment = ' '
ValueNodeList, [])
SourceFileNodeList, [])
return Root
##
# UserExtensionBinaryXml
#
class UserExtensionBinaryXml(object):
if Key:
pass
pass
Dict = {}
ValueList = []
Target = ''
Family = ''
TagName = ''
Comment = ''
return Dict
pass
BinariesNodeList = []
FileNodeList = []
ValueNodeList = []
Target = ' '
Family = ' '
TagName = ' '
Comment = ' '
ValueNodeList, [])
return Root
##
# LibraryClassXml
#
class LibraryClassXml(object):
return LibraryClass
if self.HeaderFile:
pass
AttributeList = \
]
Tmp = HelpTextXml()
return Root
if self.HeaderFile:
pass
AttributeList = \
['FeatureFlag', FeatureFlag]
]
Tmp = HelpTextXml()
return Root
Str = "Keyword = %s HeaderFile = %s RecommendedInstanceGuid = %s RecommendedInstanceVersion = %s %s" % \
return Str
##
# FilenameXml
#
class FilenameXml(object):
#
# Convert File Type
#
return Filename
pass
AttributeList = [['SupArchList', \
]
return Root
return "FileType = %s Filename = %s %s" \