summaryrefslogtreecommitdiffstats
path: root/BaseTools/Scripts
diff options
context:
space:
mode:
authorGary Lin <glin@suse.com>2018-06-25 18:31:33 +0800
committerYonghong Zhu <yonghong.zhu@intel.com>2018-06-27 16:33:25 +0800
commitccaa7754a29728df0a7485932aab4909f6be116a (patch)
tree38bc70e26055b57ff5adefe0d996fc7e2c9d62b4 /BaseTools/Scripts
parentdf29fd130abcc3094b8c5d842e4bfadd91cbf0e8 (diff)
downloadedk2-ccaa7754a29728df0a7485932aab4909f6be116a.tar.gz
edk2-ccaa7754a29728df0a7485932aab4909f6be116a.tar.bz2
edk2-ccaa7754a29728df0a7485932aab4909f6be116a.zip
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>
Diffstat (limited to 'BaseTools/Scripts')
-rw-r--r--BaseTools/Scripts/BinToPcd.py6
-rw-r--r--BaseTools/Scripts/FormatDosFiles.py2
-rw-r--r--BaseTools/Scripts/MemoryProfileSymbolGen.py6
-rw-r--r--BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/basemodel/doxygen.py4
-rwxr-xr-xBaseTools/Scripts/PatchCheck.py2
-rw-r--r--BaseTools/Scripts/RunMakefile.py2
6 files changed, 11 insertions, 11 deletions
diff --git a/BaseTools/Scripts/BinToPcd.py b/BaseTools/Scripts/BinToPcd.py
index 10b5043325..c42e37bd11 100644
--- a/BaseTools/Scripts/BinToPcd.py
+++ b/BaseTools/Scripts/BinToPcd.py
@@ -41,13 +41,13 @@ if __name__ == '__main__':
return Value
def ValidatePcdName (Argument):
- if re.split ('[a-zA-Z\_][a-zA-Z0-9\_]*\.[a-zA-Z\_][a-zA-Z0-9\_]*', Argument) != ['','']:
+ if re.split ('[a-zA-Z\_][a-zA-Z0-9\_]*\.[a-zA-Z\_][a-zA-Z0-9\_]*', Argument) != ['', '']:
Message = '{Argument} is not in the form <PcdTokenSpaceGuidCName>.<PcdCName>'.format (Argument = Argument)
raise argparse.ArgumentTypeError (Message)
return Argument
def ValidateGuidName (Argument):
- if re.split ('[a-zA-Z\_][a-zA-Z0-9\_]*', Argument) != ['','']:
+ if re.split ('[a-zA-Z\_][a-zA-Z0-9\_]*', Argument) != ['', '']:
Message = '{Argument} is not a valid GUID C name'.format (Argument = Argument)
raise argparse.ArgumentTypeError (Message)
return Argument
@@ -84,7 +84,7 @@ if __name__ == '__main__':
help = "Output filename for PCD value or PCD statement")
parser.add_argument ("-p", "--pcd", dest = 'PcdName', type = ValidatePcdName,
help = "Name of the PCD in the form <PcdTokenSpaceGuidCName>.<PcdCName>")
- parser.add_argument ("-t", "--type", dest = 'PcdType', default = None, choices = ['VPD','HII'],
+ parser.add_argument ("-t", "--type", dest = 'PcdType', default = None, choices = ['VPD', 'HII'],
help = "PCD statement type (HII or VPD). Default is standard.")
parser.add_argument ("-m", "--max-size", dest = 'MaxSize', type = ValidateUnsignedInteger,
help = "Maximum size of the PCD. Ignored with --type HII.")
diff --git a/BaseTools/Scripts/FormatDosFiles.py b/BaseTools/Scripts/FormatDosFiles.py
index 3b16af5a44..1c6b8e2b0b 100644
--- a/BaseTools/Scripts/FormatDosFiles.py
+++ b/BaseTools/Scripts/FormatDosFiles.py
@@ -62,7 +62,7 @@ def FormatFilesInDir(DirPath, ExtList, Args):
FormatFile(File, Args)
if __name__ == "__main__":
- parser = argparse.ArgumentParser(prog=__prog__,description=__description__ + __copyright__, conflict_handler = 'resolve')
+ parser = argparse.ArgumentParser(prog=__prog__, description=__description__ + __copyright__, conflict_handler = 'resolve')
parser.add_argument('Path', nargs='+',
help='the path for files to be converted.It could be directory or file path.')
diff --git a/BaseTools/Scripts/MemoryProfileSymbolGen.py b/BaseTools/Scripts/MemoryProfileSymbolGen.py
index 0a41f9d832..1dbb116bba 100644
--- a/BaseTools/Scripts/MemoryProfileSymbolGen.py
+++ b/BaseTools/Scripts/MemoryProfileSymbolGen.py
@@ -191,7 +191,7 @@ def processLine(newline):
driverPrefixLen = len("Driver - ")
# get driver name
- if cmp(newline[0:driverPrefixLen],"Driver - ") == 0 :
+ if cmp(newline[0:driverPrefixLen], "Driver - ") == 0 :
driverlineList = newline.split(" ")
driverName = driverlineList[2]
#print "Checking : ", driverName
@@ -214,7 +214,7 @@ def processLine(newline):
else :
symbolsFile.symbolsTable[driverName].parse_debug_file (driverName, pdbName)
- elif cmp(newline,"") == 0 :
+ elif cmp(newline, "") == 0 :
driverName = ""
# check entry line
@@ -227,7 +227,7 @@ def processLine(newline):
rvaName = ""
symbolName = ""
- if cmp(rvaName,"") == 0 :
+ if cmp(rvaName, "") == 0 :
return newline
else :
return newline + symbolName
diff --git a/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/basemodel/doxygen.py b/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/basemodel/doxygen.py
index fe2ba1d8a8..b5ab213cd7 100644
--- a/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/basemodel/doxygen.py
+++ b/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/basemodel/doxygen.py
@@ -66,7 +66,7 @@ class Page(BaseDoxygeItem):
def AddSection(self, section):
self.mSections.append(section)
- self.mSections.sort(cmp=lambda x,y: cmp(x.mName.lower(), y.mName.lower()))
+ self.mSections.sort(cmp=lambda x, y: cmp(x.mName.lower(), y.mName.lower()))
def Generate(self):
if self.mIsMainPage:
@@ -91,7 +91,7 @@ class Page(BaseDoxygeItem):
self.mText.insert(endIndex, '<ul>')
endIndex += 1
if self.mIsSort:
- self.mSubPages.sort(cmp=lambda x,y: cmp(x.mName.lower(), y.mName.lower()))
+ self.mSubPages.sort(cmp=lambda x, y: cmp(x.mName.lower(), y.mName.lower()))
for page in self.mSubPages:
self.mText.insert(endIndex, '<li>\subpage %s \"%s\" </li>' % (page.mTag, page.mName))
endIndex += 1
diff --git a/BaseTools/Scripts/PatchCheck.py b/BaseTools/Scripts/PatchCheck.py
index 43bfc2495c..7b7fba8b70 100755
--- a/BaseTools/Scripts/PatchCheck.py
+++ b/BaseTools/Scripts/PatchCheck.py
@@ -285,7 +285,7 @@ class GitDiffCheck:
if self.state == START:
if line.startswith('diff --git'):
self.state = PRE_PATCH
- self.filename = line[13:].split(' ',1)[0]
+ self.filename = line[13:].split(' ', 1)[0]
self.is_newfile = False
self.force_crlf = not self.filename.endswith('.sh')
elif len(line.rstrip()) != 0:
diff --git a/BaseTools/Scripts/RunMakefile.py b/BaseTools/Scripts/RunMakefile.py
index 48bc198c76..6d0c4553c9 100644
--- a/BaseTools/Scripts/RunMakefile.py
+++ b/BaseTools/Scripts/RunMakefile.py
@@ -149,7 +149,7 @@ if __name__ == '__main__':
for Item in gArgs.Define:
if '=' not in Item[0]:
continue
- Item = Item[0].split('=',1)
+ Item = Item[0].split('=', 1)
CommandLine.append('%s="%s"' % (Item[0], Item[1]))
CommandLine.append('EXTRA_FLAGS="%s"' % (gArgs.Remaining))
CommandLine.append(gArgs.BuildType)