## @file\r
-# This file is used to define class objects of INF file [UserExtension] section. \r
-# It will consumed by InfParser. \r
+# This file is used to define class objects of INF file [UserExtension] section.\r
+# It will consumed by InfParser.\r
#\r
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>\r
#\r
-# This program and the accompanying materials are licensed and made available \r
-# under the terms and conditions of the BSD License which accompanies this \r
-# distribution. The full text of the license may be found at \r
+# This program and the accompanying materials are licensed and made available\r
+# under the terms and conditions of the BSD License which accompanies this\r
+# distribution. The full text of the license may be found at\r
# http://opensource.org/licenses/bsd-license.php\r
#\r
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
from Logger import StringTable as ST\r
from Logger import ToolError\r
import Logger.Log as Logger\r
-from Library import GlobalData \r
+from Library import GlobalData\r
\r
from Library.Misc import Sdict\r
\r
self.UserId = UserId\r
self.IdString = IdString\r
self.SupArchList = []\r
- \r
+\r
def SetContent(self, Content):\r
self.Content = Content\r
def GetContent(self):\r
return self.Content\r
- \r
+\r
def SetUserId(self, UserId):\r
self.UserId = UserId\r
def GetUserId(self):\r
return self.UserId\r
- \r
+\r
def SetIdString(self, IdString):\r
self.IdString = IdString\r
def GetIdString(self):\r
return self.IdString\r
- \r
+\r
def SetSupArchList(self, SupArchList):\r
self.SupArchList = SupArchList\r
def GetSupArchList(self):\r
return self.SupArchList\r
- \r
+\r
##\r
#\r
#\r
class InfUserExtensionObject():\r
def __init__(self):\r
self.UserExtension = Sdict()\r
- \r
+\r
def SetUserExtension(self, UserExtensionCont, IdContent=None, LineNo=None):\r
if not UserExtensionCont or UserExtensionCont == '':\r
return True\r
#\r
- # IdContent is a list contain UserId and IdString \r
+ # IdContent is a list contain UserId and IdString\r
# For this call the general section header parser, if no definition of\r
# IdString/UserId, it will return 'COMMON'\r
#\r
- for IdContentItem in IdContent: \r
+ for IdContentItem in IdContent:\r
InfUserExtensionItemObj = InfUserExtensionItem()\r
if IdContentItem[0] == 'COMMON':\r
UserId = ''\r
else:\r
UserId = IdContentItem[0]\r
- \r
+\r
if IdContentItem[1] == 'COMMON':\r
IdString = ''\r
else:\r
- IdString = IdContentItem[1] \r
- \r
+ IdString = IdContentItem[1]\r
+\r
#\r
# Fill UserExtensionObj members.\r
- # \r
+ #\r
InfUserExtensionItemObj.SetUserId(UserId)\r
InfUserExtensionItemObj.SetIdString(IdString)\r
InfUserExtensionItemObj.SetContent(UserExtensionCont)\r
- InfUserExtensionItemObj.SetSupArchList(IdContentItem[2]) \r
- \r
+ InfUserExtensionItemObj.SetSupArchList(IdContentItem[2])\r
+\r
# for CheckItem in self.UserExtension:\r
# if IdContentItem[0] == CheckItem[0] and IdContentItem[1] == CheckItem[1]:\r
# if IdContentItem[2].upper() == 'COMMON' or CheckItem[2].upper() == 'COMMON':\r
# #\r
# # For COMMON ARCH type, do special check.\r
# #\r
-# Logger.Error('InfParser', \r
+# Logger.Error('InfParser',\r
# ToolError.FORMAT_INVALID,\r
# ST.ERR_INF_PARSER_UE_SECTION_DUPLICATE_ERROR%\\r
# (IdContentItem[0] + '.' + IdContentItem[1] + '.' + IdContentItem[2]),\r
-# File=GlobalData.gINF_MODULE_NAME, \r
+# File=GlobalData.gINF_MODULE_NAME,\r
# Line=LineNo,\r
# ExtraData=None)\r
- \r
+\r
if IdContentItem in self.UserExtension:\r
#\r
- # Each UserExtensions section header must have a unique set \r
+ # Each UserExtensions section header must have a unique set\r
# of UserId, IdString and Arch values.\r
- # This means that the same UserId can be used in more than one \r
- # section header, provided the IdString or Arch values are \r
- # different. The same IdString values can be used in more than \r
- # one section header if the UserId or Arch values are \r
- # different. The same UserId and the same IdString can be used \r
- # in a section header if the Arch values are different in each \r
+ # This means that the same UserId can be used in more than one\r
+ # section header, provided the IdString or Arch values are\r
+ # different. The same IdString values can be used in more than\r
+ # one section header if the UserId or Arch values are\r
+ # different. The same UserId and the same IdString can be used\r
+ # in a section header if the Arch values are different in each\r
# of the section headers.\r
#\r
- Logger.Error('InfParser', \r
+ Logger.Error('InfParser',\r
ToolError.FORMAT_INVALID,\r
ST.ERR_INF_PARSER_UE_SECTION_DUPLICATE_ERROR%\\r
(IdContentItem[0] + '.' + IdContentItem[1] + '.' + IdContentItem[2]),\r
- File=GlobalData.gINF_MODULE_NAME, \r
+ File=GlobalData.gINF_MODULE_NAME,\r
Line=LineNo,\r
ExtraData=None)\r
else:\r
UserExtensionList = []\r
UserExtensionList.append(InfUserExtensionItemObj)\r
self.UserExtension[IdContentItem] = UserExtensionList\r
- \r
+\r
return True\r
- \r
+\r
def GetUserExtension(self):\r
return self.UserExtension\r