_TempInfs = []\r
\r
def GetVariableOffset(mapfilepath, efifilepath, varnames):\r
- """ Parse map file to get variable offset in current EFI file \r
+ """ Parse map file to get variable offset in current EFI file\r
@param mapfilepath Map file absolution path\r
@param efifilepath: EFI binary file full path\r
@param varnames iteratable container whose elements are variable names to be searched\r
- \r
+\r
@return List whos elements are tuple with variable name and raw offset\r
"""\r
lines = []\r
f.close()\r
except:\r
return None\r
- \r
+\r
if len(lines) == 0: return None\r
firstline = lines[0].strip()\r
if (firstline.startswith("Archive member included ") and\r
continue\r
if line.startswith("entry point at"):\r
status = 3\r
- continue \r
+ continue\r
if status == 1 and len(line) != 0:\r
m = secReGeneral.match(line)\r
assert m is not None, "Fail to parse the section in map file , line is %s" % line\r
#\r
# A temporary INF is copied to database path which must have write permission\r
# The temporary will be removed at the end of build\r
- # In case of name conflict, the file name is \r
+ # In case of name conflict, the file name is\r
# FILE_GUIDBaseName (0D1B936F-68F3-4589-AFCC-FB8B7AEBC836module.inf)\r
#\r
TempFullPath = os.path.join(DbDir,\r
#\r
# To build same module more than once, the module path with FILE_GUID overridden has\r
# the file name FILE_GUIDmodule.inf, but the relative path (self.MetaFile.File) is the real path\r
- # in DSC which is used as relative path by C files and other files in INF. \r
+ # in DSC which is used as relative path by C files and other files in INF.\r
# A trick was used: all module paths are PathClass instances, after the initialization\r
# of PathClass, the PathClass.Path is overridden by the temporary INF path.\r
#\r
# If file exists, compare contents\r
#\r
if os.path.exists(TempFullPath):\r
- with open(str(Path), 'rb') as f1, open(TempFullPath, 'rb') as f2: \r
+ with open(str(Path), 'rb') as f1, open(TempFullPath, 'rb') as f2:\r
if f1.read() == f2.read():\r
return RtPath\r
_TempInfs.append(TempFullPath)\r
# Used to avoid split issue while the value string contain "|" character\r
#\r
# @param[in] Setting: A String contain value/datum type/token number information;\r
-# \r
-# @retval ValueList: A List contain value, datum type and toke number. \r
+#\r
+# @retval ValueList: A List contain value, datum type and toke number.\r
#\r
def AnalyzePcdData(Setting):\r
ValueList = ['', '', '']\r
\r
ValueRe = re.compile(r'^\s*L?\".*\|.*\"')\r
PtrValue = ValueRe.findall(Setting)\r
- \r
+\r
ValueUpdateFlag = False\r
- \r
+\r
if len(PtrValue) >= 1:\r
Setting = re.sub(ValueRe, '', Setting)\r
ValueUpdateFlag = True\r
\r
TokenList = Setting.split(TAB_VALUE_SPLIT)\r
ValueList[0:len(TokenList)] = TokenList\r
- \r
+\r
if ValueUpdateFlag:\r
ValueList[0] = PtrValue[0]\r
- \r
- return ValueList \r
- \r
+\r
+ return ValueList\r
+\r
## check format of PCD value against its the datum type\r
#\r
# For PCD value setting\r
OtherKey = Other.Path\r
else:\r
OtherKey = str(Other)\r
- \r
+\r
SelfKey = self.Path\r
if SelfKey == OtherKey:\r
return 0\r
def _ByteListToStr(self, ByteList):\r
String = ''\r
for index in range(len(ByteList)):\r
- if ByteList[index] == 0: \r
+ if ByteList[index] == 0:\r
break\r
String += chr(ByteList[index])\r
return String\r
if sid == minid:\r
return name\r
class SkuClass():\r
- \r
+\r
DEFAULT = 0\r
SINGLE = 1\r
MULTIPLE =2\r
- \r
+\r
def __init__(self,SkuIdentifier='', SkuIds=None):\r
if SkuIds is None:\r
SkuIds = {}\r
EdkLogger.error("build", PARAMETER_INVALID,\r
ExtraData = "SKU-ID [%s] value %s exceeds the max value of UINT64"\r
% (SkuName, SkuId))\r
- \r
+\r
self.AvailableSkuIds = sdict()\r
self.SkuIdSet = []\r
self.SkuIdNumberSet = []\r
self.SkuIdSet = SkuIds.keys()\r
self.SkuIdNumberSet = [num[0].strip() + 'U' for num in SkuIds.values()]\r
else:\r
- r = SkuIdentifier.split('|') \r
+ r = SkuIdentifier.split('|')\r
self.SkuIdSet=[(r[k].strip()).upper() for k in range(len(r))]\r
k = None\r
- try: \r
+ try:\r
self.SkuIdNumberSet = [SkuIds[k][0].strip() + 'U' for k in self.SkuIdSet]\r
except Exception:\r
EdkLogger.error("build", PARAMETER_INVALID,\r
skuorderset = []\r
for skuname in self.SkuIdSet:\r
skuorderset.append(self.GetSkuChain(skuname))\r
- \r
+\r
skuorder = []\r
for index in range(max(len(item) for item in skuorderset)):\r
for subset in skuorderset:\r
\r
return skuorder\r
\r
- def __SkuUsageType(self): \r
- \r
+ def __SkuUsageType(self):\r
+\r
if self.__SkuIdentifier.upper() == "ALL":\r
return SkuClass.MULTIPLE\r
\r
return ArrayStr\r
def __GetAvailableSkuIds(self):\r
return self.AvailableSkuIds\r
- \r
+\r
def __GetSystemSkuID(self):\r
if self.__SkuUsageType() == SkuClass.SINGLE:\r
if len(self.SkuIdSet) == 1:\r