diff options
author | Liming Gao <liming.gao@intel.com> | 2018-07-05 17:40:04 +0800 |
---|---|---|
committer | Liming Gao <liming.gao@intel.com> | 2018-07-09 10:25:47 +0800 |
commit | f7496d717357b9af78414d19679b073403812340 (patch) | |
tree | 67621e65fd181bdf8a12d12e7706579beaaed0fb /BaseTools/Source/Python/Common/Misc.py | |
parent | 39456d00f36e04b7e7efb208f350f4e83b6c3531 (diff) | |
download | edk2-f7496d717357b9af78414d19679b073403812340.tar.gz edk2-f7496d717357b9af78414d19679b073403812340.tar.bz2 edk2-f7496d717357b9af78414d19679b073403812340.zip |
BaseTools: Clean up source files
1. Do not use tab characters
2. No trailing white space in one line
3. All files must end with CRLF
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
Diffstat (limited to 'BaseTools/Source/Python/Common/Misc.py')
-rw-r--r-- | BaseTools/Source/Python/Common/Misc.py | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/BaseTools/Source/Python/Common/Misc.py b/BaseTools/Source/Python/Common/Misc.py index 044ef8d62b..b56ddd5324 100644 --- a/BaseTools/Source/Python/Common/Misc.py +++ b/BaseTools/Source/Python/Common/Misc.py @@ -63,11 +63,11 @@ gDependencyDatabase = {} # arch : {file path : [dependent files list]} _TempInfs = []
def GetVariableOffset(mapfilepath, efifilepath, varnames):
- """ Parse map file to get variable offset in current EFI file
+ """ Parse map file to get variable offset in current EFI file
@param mapfilepath Map file absolution path
@param efifilepath: EFI binary file full path
@param varnames iteratable container whose elements are variable names to be searched
-
+
@return List whos elements are tuple with variable name and raw offset
"""
lines = []
@@ -77,7 +77,7 @@ def GetVariableOffset(mapfilepath, efifilepath, varnames): f.close()
except:
return None
-
+
if len(lines) == 0: return None
firstline = lines[0].strip()
if (firstline.startswith("Archive member included ") and
@@ -177,7 +177,7 @@ def _parseGeneral(lines, efifilepath, varnames): continue
if line.startswith("entry point at"):
status = 3
- continue
+ continue
if status == 1 and len(line) != 0:
m = secReGeneral.match(line)
assert m is not None, "Fail to parse the section in map file , line is %s" % line
@@ -257,7 +257,7 @@ def ProcessDuplicatedInf(Path, BaseName, Workspace): #
# A temporary INF is copied to database path which must have write permission
# The temporary will be removed at the end of build
- # In case of name conflict, the file name is
+ # In case of name conflict, the file name is
# FILE_GUIDBaseName (0D1B936F-68F3-4589-AFCC-FB8B7AEBC836module.inf)
#
TempFullPath = os.path.join(DbDir,
@@ -268,7 +268,7 @@ def ProcessDuplicatedInf(Path, BaseName, Workspace): #
# To build same module more than once, the module path with FILE_GUID overridden has
# the file name FILE_GUIDmodule.inf, but the relative path (self.MetaFile.File) is the real path
- # in DSC which is used as relative path by C files and other files in INF.
+ # in DSC which is used as relative path by C files and other files in INF.
# A trick was used: all module paths are PathClass instances, after the initialization
# of PathClass, the PathClass.Path is overridden by the temporary INF path.
#
@@ -287,7 +287,7 @@ def ProcessDuplicatedInf(Path, BaseName, Workspace): # If file exists, compare contents
#
if os.path.exists(TempFullPath):
- with open(str(Path), 'rb') as f1, open(TempFullPath, 'rb') as f2:
+ with open(str(Path), 'rb') as f1, open(TempFullPath, 'rb') as f2:
if f1.read() == f2.read():
return RtPath
_TempInfs.append(TempFullPath)
@@ -1545,29 +1545,29 @@ def AnalyzeDscPcd(Setting, PcdType, DataType=''): # Used to avoid split issue while the value string contain "|" character
#
# @param[in] Setting: A String contain value/datum type/token number information;
-#
-# @retval ValueList: A List contain value, datum type and toke number.
+#
+# @retval ValueList: A List contain value, datum type and toke number.
#
def AnalyzePcdData(Setting):
ValueList = ['', '', '']
ValueRe = re.compile(r'^\s*L?\".*\|.*\"')
PtrValue = ValueRe.findall(Setting)
-
+
ValueUpdateFlag = False
-
+
if len(PtrValue) >= 1:
Setting = re.sub(ValueRe, '', Setting)
ValueUpdateFlag = True
TokenList = Setting.split(TAB_VALUE_SPLIT)
ValueList[0:len(TokenList)] = TokenList
-
+
if ValueUpdateFlag:
ValueList[0] = PtrValue[0]
-
- return ValueList
-
+
+ return ValueList
+
## check format of PCD value against its the datum type
#
# For PCD value setting
@@ -1770,7 +1770,7 @@ class PathClass(object): OtherKey = Other.Path
else:
OtherKey = str(Other)
-
+
SelfKey = self.Path
if SelfKey == OtherKey:
return 0
@@ -1908,7 +1908,7 @@ class PeImageClass(): def _ByteListToStr(self, ByteList):
String = ''
for index in range(len(ByteList)):
- if ByteList[index] == 0:
+ if ByteList[index] == 0:
break
String += chr(ByteList[index])
return String
@@ -1945,11 +1945,11 @@ class DefaultStore(): if sid == minid:
return name
class SkuClass():
-
+
DEFAULT = 0
SINGLE = 1
MULTIPLE =2
-
+
def __init__(self,SkuIdentifier='', SkuIds=None):
if SkuIds is None:
SkuIds = {}
@@ -1961,7 +1961,7 @@ class SkuClass(): EdkLogger.error("build", PARAMETER_INVALID,
ExtraData = "SKU-ID [%s] value %s exceeds the max value of UINT64"
% (SkuName, SkuId))
-
+
self.AvailableSkuIds = sdict()
self.SkuIdSet = []
self.SkuIdNumberSet = []
@@ -1975,10 +1975,10 @@ class SkuClass(): self.SkuIdSet = SkuIds.keys()
self.SkuIdNumberSet = [num[0].strip() + 'U' for num in SkuIds.values()]
else:
- r = SkuIdentifier.split('|')
+ r = SkuIdentifier.split('|')
self.SkuIdSet=[(r[k].strip()).upper() for k in range(len(r))]
k = None
- try:
+ try:
self.SkuIdNumberSet = [SkuIds[k][0].strip() + 'U' for k in self.SkuIdSet]
except Exception:
EdkLogger.error("build", PARAMETER_INVALID,
@@ -2027,7 +2027,7 @@ class SkuClass(): skuorderset = []
for skuname in self.SkuIdSet:
skuorderset.append(self.GetSkuChain(skuname))
-
+
skuorder = []
for index in range(max(len(item) for item in skuorderset)):
for subset in skuorderset:
@@ -2039,8 +2039,8 @@ class SkuClass(): return skuorder
- def __SkuUsageType(self):
-
+ def __SkuUsageType(self):
+
if self.__SkuIdentifier.upper() == "ALL":
return SkuClass.MULTIPLE
@@ -2073,7 +2073,7 @@ class SkuClass(): return ArrayStr
def __GetAvailableSkuIds(self):
return self.AvailableSkuIds
-
+
def __GetSystemSkuID(self):
if self.__SkuUsageType() == SkuClass.SINGLE:
if len(self.SkuIdSet) == 1:
|