NewRecordList = []\r
for Record in RecordList:\r
Arch = Record[3]\r
- if Arch == 'COMMON' or Arch == FilterArch:\r
+ if Arch == TAB_ARCH_COMMON or Arch == FilterArch:\r
NewRecordList.append(Record)\r
return NewRecordList\r
\r
self.Start()\r
\r
# No specific ARCH or Platform given, use raw data\r
- if self._RawTable and (len(DataInfo) == 1 or DataInfo[1] == None):\r
+ if self._RawTable and (len(DataInfo) == 1 or DataInfo[1] is None):\r
return self._FilterRecordList(self._RawTable.Query(*DataInfo), self._Arch)\r
\r
# Do post-process if necessary\r
if len(ItemList) > 1:\r
S1 = ItemList[1].upper()\r
else:\r
- S1 = 'COMMON'\r
+ S1 = TAB_ARCH_COMMON\r
ArchList.add(S1)\r
\r
# S2 may be Platform or ModuleType\r
else:\r
S2 = ItemList[2].upper()\r
else:\r
- S2 = 'COMMON'\r
+ S2 = TAB_COMMON\r
if len(ItemList) > 3:\r
S3 = ItemList[3]\r
else:\r
- S3 = "COMMON"\r
+ S3 = TAB_COMMON\r
self._Scope.append([S1, S2, S3])\r
\r
# 'COMMON' must not be used with specific ARCHs at the same section\r
- if 'COMMON' in ArchList and len(ArchList) > 1:\r
+ if TAB_ARCH_COMMON in ArchList and len(ArchList) > 1:\r
EdkLogger.error('Parser', FORMAT_INVALID, "'common' ARCH must not be used with specific ARCHs",\r
File=self.MetaFile, Line=self._LineIndex + 1, ExtraData=self._CurrentLine)\r
# If the section information is needed later, it should be stored in database\r
\r
for ActiveScope in self._Scope:\r
Scope0, Scope1,Scope2 = ActiveScope[0], ActiveScope[1],ActiveScope[2]\r
- if(Scope0, Scope1,Scope2) not in Scope and (Scope0, "COMMON","COMMON") not in Scope and ("COMMON", Scope1,"COMMON") not in Scope:\r
+ if(Scope0, Scope1,Scope2) not in Scope and (Scope0, TAB_COMMON, TAB_COMMON) not in Scope and (TAB_COMMON, Scope1, TAB_COMMON) not in Scope:\r
break\r
else:\r
ComSpeMacroDict.update(self._SectionsMacroDict[(SectionType, Scope)])\r
\r
- if ("COMMON", "COMMON","COMMON") in Scope:\r
+ if (TAB_COMMON, TAB_COMMON, TAB_COMMON) in Scope:\r
ComComMacroDict.update(self._SectionsMacroDict[(SectionType, Scope)])\r
\r
Macros.update(ComComMacroDict)\r
if Line[0] == TAB_SECTION_START and Line[-1] == TAB_SECTION_END:\r
if not GetHeaderComment:\r
for Cmt, LNo in Comments:\r
- self._Store(MODEL_META_DATA_HEADER_COMMENT, Cmt, '', '', 'COMMON',\r
- 'COMMON', self._Owner[-1], LNo, -1, LNo, -1, 0)\r
+ self._Store(MODEL_META_DATA_HEADER_COMMENT, Cmt, '', '', TAB_COMMON,\r
+ TAB_COMMON, self._Owner[-1], LNo, -1, LNo, -1, 0)\r
GetHeaderComment = True\r
else:\r
TailComments.extend(SectionComments + Comments)\r
self._ValueList = ['', '', '']\r
# parse current line, result will be put in self._ValueList\r
self._SectionParser[self._SectionType](self)\r
- if self._ValueList == None or self._ItemType == MODEL_META_DATA_DEFINE:\r
+ if self._ValueList is None or self._ItemType == MODEL_META_DATA_DEFINE:\r
self._ItemType = -1\r
Comments = []\r
continue\r
\r
# If there are tail comments in INF file, save to database whatever the comments are\r
for Comment in TailComments:\r
- self._Store(MODEL_META_DATA_TAIL_COMMENT, Comment[0], '', '', 'COMMON',\r
- 'COMMON', self._Owner[-1], -1, -1, -1, -1, 0)\r
+ self._Store(MODEL_META_DATA_TAIL_COMMENT, Comment[0], '', '', TAB_COMMON,\r
+ TAB_COMMON, self._Owner[-1], -1, -1, -1, -1, 0)\r
self._Done()\r
\r
## Data parser for the format in which there's path\r
\r
self._ValueList = ['', '', '']\r
self._SectionParser[SectionType](self)\r
- if self._ValueList == None:\r
+ if self._ValueList is None:\r
continue\r
#\r
# Model, Value1, Value2, Value3, Arch, ModuleType, BelongsToItem=-1, BelongsToFile=-1,\r
ExtraData=self._CurrentLine)\r
\r
ItemType = self.DataType[DirectiveName]\r
- Scope = [['COMMON', 'COMMON','COMMON']]\r
+ Scope = [[TAB_COMMON, TAB_COMMON, TAB_COMMON]]\r
if ItemType == MODEL_META_DATA_INCLUDE:\r
Scope = self._Scope\r
if ItemType == MODEL_META_DATA_CONDITIONAL_STATEMENT_ENDIF:\r
Macros.update(self._Symbols)\r
if GlobalData.BuildOptionPcd:\r
for Item in GlobalData.BuildOptionPcd:\r
+ if type(Item) is tuple:\r
+ continue\r
PcdName, TmpValue = Item.split("=")\r
+ TmpValue = BuildOptionValue(TmpValue, self._GuidDict)\r
Macros[PcdName.strip()] = TmpValue\r
return Macros\r
\r
File=self._FileWithError, ExtraData=' '.join(self._ValueList),\r
Line=self._LineIndex + 1)\r
\r
- if self._ValueList == None:\r
+ if self._ValueList is None:\r
continue\r
\r
NewOwner = self._IdMapping.get(Owner, -1)\r
# Allow using system environment variables in path after !include\r
#\r
__IncludeMacros['WORKSPACE'] = GlobalData.gGlobalDefines['WORKSPACE']\r
- if "ECP_SOURCE" in GlobalData.gGlobalDefines.keys():\r
+ if "ECP_SOURCE" in GlobalData.gGlobalDefines:\r
__IncludeMacros['ECP_SOURCE'] = GlobalData.gGlobalDefines['ECP_SOURCE']\r
#\r
# During GenFds phase call DSC parser, will go into this branch.\r
#\r
- elif "ECP_SOURCE" in GlobalData.gCommandLineDefines.keys():\r
+ elif "ECP_SOURCE" in GlobalData.gCommandLineDefines:\r
__IncludeMacros['ECP_SOURCE'] = GlobalData.gCommandLineDefines['ECP_SOURCE']\r
\r
__IncludeMacros['EFI_SOURCE'] = GlobalData.gGlobalDefines['EFI_SOURCE']\r
# section content\r
self._ValueList = ['', '', '']\r
self._SectionParser[self._SectionType[0]](self)\r
- if self._ValueList == None or self._ItemType == MODEL_META_DATA_DEFINE:\r
+ if self._ValueList is None or self._ItemType == MODEL_META_DATA_DEFINE:\r
self._ItemType = -1\r
self._Comments = []\r
continue\r
if len(ItemList) > 1:\r
S1 = ItemList[1].upper()\r
else:\r
- S1 = 'COMMON'\r
+ S1 = TAB_ARCH_COMMON\r
ArchList.add(S1)\r
# S2 may be Platform or ModuleType\r
if len(ItemList) > 2:\r
EdkLogger.error("Parser", FORMAT_INVALID, 'Please use keyword "Private" as section tag modifier.',\r
File=self.MetaFile, Line=self._LineIndex + 1, ExtraData=self._CurrentLine)\r
else:\r
- S2 = 'COMMON'\r
+ S2 = TAB_COMMON\r
PrivateList.add(S2)\r
if [S1, S2, self.DataType[self._SectionName]] not in self._Scope:\r
self._Scope.append([S1, S2, self.DataType[self._SectionName]])\r
\r
# 'COMMON' must not be used with specific ARCHs at the same section\r
- if 'COMMON' in ArchList and len(ArchList) > 1:\r
+ if TAB_ARCH_COMMON in ArchList and len(ArchList) > 1:\r
EdkLogger.error('Parser', FORMAT_INVALID, "'common' ARCH must not be used with specific ARCHs",\r
File=self.MetaFile, Line=self._LineIndex + 1, ExtraData=self._CurrentLine)\r
\r
# It is not permissible to mix section tags without the Private attribute with section tags with the Private attribute\r
- if 'COMMON' in PrivateList and len(PrivateList) > 1:\r
+ if TAB_COMMON in PrivateList and len(PrivateList) > 1:\r
EdkLogger.error('Parser', FORMAT_INVALID, "Can't mix section tags without the Private attribute with section tags with the Private attribute",\r
File=self.MetaFile, Line=self._LineIndex + 1, ExtraData=self._CurrentLine)\r
\r