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:
@@ -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.")
|
||||
|
@@ -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.')
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
|
@@ -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:
|
||||
|
@@ -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)
|
||||
|
Reference in New Issue
Block a user