BaseTools: Adjust the spaces around commas and colons

Based on "futurize -f lib2to3.fixes.fix_ws_comma"

Contributed-under: TianoCore Contribution Agreement 1.1
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Gary Lin <glin@suse.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
This commit is contained in:
Gary Lin
2018-06-25 18:31:33 +08:00
committed by Yonghong Zhu
parent df29fd130a
commit ccaa7754a2
57 changed files with 543 additions and 543 deletions

View File

@ -261,7 +261,7 @@ def TrimPreprocessedVfr(Source, Target):
CreateDirectory(os.path.dirname(Target))
try:
f = open (Source,'r')
f = open (Source, 'r')
except:
EdkLogger.error("Trim", FILE_OPEN_FAILURE, ExtraData=Source)
# read whole file
@ -310,7 +310,7 @@ def TrimPreprocessedVfr(Source, Target):
# save all lines trimmed
try:
f = open (Target,'w')
f = open (Target, 'w')
except:
EdkLogger.error("Trim", FILE_OPEN_FAILURE, ExtraData=Target)
f.writelines(Lines)
@ -407,7 +407,7 @@ def TrimAslFile(Source, Target, IncludePathFile):
if IncludePathFile:
try:
LineNum = 0
for Line in open(IncludePathFile,'r'):
for Line in open(IncludePathFile, 'r'):
LineNum += 1
if Line.startswith("/I") or Line.startswith ("-I"):
IncludePathList.append(Line[2:].strip())
@ -425,7 +425,7 @@ def TrimAslFile(Source, Target, IncludePathFile):
# save all lines trimmed
try:
f = open (Target,'w')
f = open (Target, 'w')
except:
EdkLogger.error("Trim", FILE_OPEN_FAILURE, ExtraData=Target)
@ -560,7 +560,7 @@ def TrimEdkSourceCode(Source, Target):
CreateDirectory(os.path.dirname(Target))
try:
f = open (Source,'rb')
f = open (Source, 'rb')
except:
EdkLogger.error("Trim", FILE_OPEN_FAILURE, ExtraData=Source)
# read whole file
@ -568,7 +568,7 @@ def TrimEdkSourceCode(Source, Target):
f.close()
NewLines = None
for Re,Repl in gImportCodePatterns:
for Re, Repl in gImportCodePatterns:
if NewLines is None:
NewLines = Re.sub(Repl, Lines)
else:
@ -579,7 +579,7 @@ def TrimEdkSourceCode(Source, Target):
return
try:
f = open (Target,'wb')
f = open (Target, 'wb')
except:
EdkLogger.error("Trim", FILE_OPEN_FAILURE, ExtraData=Target)
f.write(NewLines)