BaseTools: Various typo

Various typo in BaseTools.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Coeur <coeur@gmx.fr>
Reviewed-by: Liming Gao <liming.gao@intel.com>
This commit is contained in:
Antoine Coeur
2019-02-06 15:44:39 +08:00
committed by Liming Gao
parent 325ad62260
commit fb0b35e05f
172 changed files with 510 additions and 515 deletions

View File

@@ -426,7 +426,7 @@ def _CheckListExpression(Expression):
return IsValidListExpr(ListExpr)
## _CheckExpreesion
## _CheckExpression
#
# @param Expression: Pcd value expression
#
@@ -476,11 +476,11 @@ def _ValidateCopyright(Line):
def GenerateTokenList (Comment):
#
# Tokenize Comment using '#' and ' ' as token seperators
# Tokenize Comment using '#' and ' ' as token separators
#
RelplacedComment = None
while Comment != RelplacedComment:
RelplacedComment = Comment
ReplacedComment = None
while Comment != ReplacedComment:
ReplacedComment = Comment
Comment = Comment.replace('##', '#').replace(' ', ' ').replace(' ', '#').strip('# ')
return Comment.split('#')
@@ -538,13 +538,13 @@ def ParseComment (Comment, UsageTokens, TypeTokens, RemoveTokens, ParseVariable)
NumTokens = 1
#
# Initialze HelpText to Comment.
# Initialize HelpText to Comment.
# Content will be remove from HelpText as matching tokens are found
#
HelpText = Comment
#
# Tokenize Comment using '#' and ' ' as token seperators
# Tokenize Comment using '#' and ' ' as token separators
#
List = GenerateTokenList (Comment)

View File

@@ -93,7 +93,7 @@ TAB_STR_TOKENHELP = 'HELP'
TAB_STR_TOKENERR = 'ERR'
#
# Dictionary of usage tokens and their synonmys
# Dictionary of usage tokens and their synonyms
#
ALL_USAGE_TOKENS = {
"PRODUCES" : "PRODUCES",

View File

@@ -43,7 +43,7 @@ gINVALID_MODULE_FILE = gUPT_DIR + r"Invalid_Modules.log"
gCONTENT_FILE = "dist.content"
#
# File name for XML file in the distibution
# File name for XML file in the distribution
#
gDESC_FILE = 'dist.pkg'

View File

@@ -788,7 +788,7 @@ def GetLibInstanceInfo(String, WorkSpace, LineNo):
FileGuidString = ""
VerString = ""
OrignalString = String
OriginalString = String
String = String.strip()
if not String:
return None, None
@@ -808,7 +808,7 @@ def GetLibInstanceInfo(String, WorkSpace, LineNo):
ST.ERR_FILELIST_EXIST % (String),
File=GlobalData.gINF_MODULE_NAME,
Line=LineNo,
ExtraData=OrignalString)
ExtraData=OriginalString)
#
# Validate file exist/format.
@@ -821,7 +821,7 @@ def GetLibInstanceInfo(String, WorkSpace, LineNo):
ST.ERR_INF_PARSER_FILE_NOT_EXIST_OR_NAME_INVALID % (String),
File=GlobalData.gINF_MODULE_NAME,
Line=LineNo,
ExtraData=OrignalString)
ExtraData=OriginalString)
return False
if IsValidFileFlag:
FileLinesList = []
@@ -973,7 +973,7 @@ def ValidateUNIFilePath(Path):
ExtraData=Path)
#
# Check if '..' in the file name(without suffixe)
# Check if '..' in the file name(without suffix)
#
if (TAB_SPLIT + TAB_SPLIT) in Path:
Logger.Error("Unicode File Parser",

View File

@@ -13,7 +13,7 @@
#
'''
PaserValidate
ParserValidate
'''
import os.path
@@ -68,7 +68,7 @@ def IsValidHex(HexStr):
#
def IsValidBoolType(BoolString):
#
# Valid Ture
# Valid True
#
if BoolString == 'TRUE' or \
BoolString == 'True' or \
@@ -124,11 +124,11 @@ def IsValidInfComponentType(ComponentType):
## Is valid Tool Family or not
#
# @param ToolFamily: A string contain Tool Family need to be judged.
# Famlily := [A-Z]([a-zA-Z0-9])*
# Family := [A-Z]([a-zA-Z0-9])*
#
def IsValidToolFamily(ToolFamily):
ReIsValieFamily = re.compile(r"^[A-Z]+[A-Za-z0-9]{0,}$", re.DOTALL)
if ReIsValieFamily.match(ToolFamily) is None:
ReIsValidFamily = re.compile(r"^[A-Z]+[A-Za-z0-9]{0,}$", re.DOTALL)
if ReIsValidFamily.match(ToolFamily) is None:
return False
return True
@@ -158,8 +158,8 @@ def IsValidToolTagName(TagName):
def IsValidArch(Arch):
if Arch == 'common':
return True
ReIsValieArch = re.compile(r"^[a-zA-Z]+[a-zA-Z0-9]{0,}$", re.DOTALL)
if ReIsValieArch.match(Arch) is None:
ReIsValidArch = re.compile(r"^[a-zA-Z]+[a-zA-Z0-9]{0,}$", re.DOTALL)
if ReIsValidArch.match(Arch) is None:
return False
return True

View File

@@ -959,7 +959,7 @@ def MacroParser(Line, FileName, SectionType, FileLocalMacros):
# INF, DEC specs
# @param SectionDict: section statement dict, key is SectionAttrs(arch,
# moduletype or platform may exist as needed) list
# seperated by space,
# separated by space,
# value is statement
#
def GenSection(SectionName, SectionDict, SplitArch=True, NeedBlankLine=False):

View File

@@ -33,7 +33,7 @@ gMACRO_PATTERN = re.compile("\$\(([_A-Z][_A-Z0-9]*)\)", re.UNICODE)
## GetSplitValueList
#
# Get a value list from a string with multiple values splited with SplitTag
# Get a value list from a string with multiple values split with SplitTag
# The default SplitTag is DataType.TAB_VALUE_SPLIT
# 'AAA|BBB|CCC' -> ['AAA', 'BBB', 'CCC']
#
@@ -67,7 +67,7 @@ def MergeArches(Dict, Key, Arch):
# Return False if invalid format
#
# @param String: String with DEFINE statement
# @param Arch: Supportted Arch
# @param Arch: Supported Arch
# @param Defines: DEFINE statement to be parsed
#
def GenDefines(String, Arch, Defines):
@@ -236,7 +236,7 @@ def ReplaceMacro(String, MacroDefinitions=None, SelfReplacement=False, Line=None
## NormPath
#
# Create a normal path
# And replace DFEINE in the path
# And replace DEFINE in the path
#
# @param Path: The input value for Path to be converted
# @param Defines: A set for DEFINE statement
@@ -613,9 +613,9 @@ def WorkspaceFile(WorkspaceDir, Filename):
## Split string
#
# Revmove '"' which startswith and endswith string
# Remove '"' which startswith and endswith string
#
# @param String: The string need to be splited
# @param String: The string need to be split
#
def SplitString(String):
if String.startswith('\"'):
@@ -734,7 +734,7 @@ def IsHexDigit(Str):
return False
return False
## Check if the string is HexDgit and its interger value within limit of UINT32
## Check if the string is HexDgit and its integer value within limit of UINT32
#
# Return true if all characters in the string are digits and there is at
# least one character

View File

@@ -130,12 +130,12 @@ def ConvertSpecialUnicodes(Uni):
## GetLanguageCode1766
#
# Check the language code read from .UNI file and convert RFC 4646 codes to RFC 1766 codes
# RFC 1766 language codes supported in compatiblity mode
# RFC 1766 language codes supported in compatibility mode
# RFC 4646 language codes supported in native mode
#
# @param LangName: Language codes read from .UNI file
#
# @retval LangName: Valid lanugage code in RFC 1766 format or None
# @retval LangName: Valid language code in RFC 1766 format or None
#
def GetLanguageCode1766(LangName, File=None):
return LangName
@@ -177,7 +177,7 @@ def GetLanguageCode1766(LangName, File=None):
## GetLanguageCode
#
# Check the language code read from .UNI file and convert RFC 1766 codes to RFC 4646 codes if appropriate
# RFC 1766 language codes supported in compatiblity mode
# RFC 1766 language codes supported in compatibility mode
# RFC 4646 language codes supported in native mode
#
# @param LangName: Language codes read from .UNI file
@@ -221,13 +221,13 @@ def GetLanguageCode(LangName, IsCompatibleMode, File):
## FormatUniEntry
#
# Formated the entry in Uni file.
# Formatted the entry in Uni file.
#
# @param StrTokenName StrTokenName.
# @param TokenValueList A list need to be processed.
# @param ContainerFile ContainerFile.
#
# @return formated entry
# @return formatted entry
def FormatUniEntry(StrTokenName, TokenValueList, ContainerFile):
SubContent = ''
PreFormatLength = 40
@@ -478,8 +478,8 @@ class UniFileClassObject(object):
MultiLineFeedExits = False
#
# 0: initial value
# 1: signle String entry exist
# 2: line feed exist under the some signle String entry
# 1: single String entry exist
# 2: line feed exist under the some single String entry
#
StringEntryExistsFlag = 0
for Line in FileIn:
@@ -497,7 +497,7 @@ class UniFileClassObject(object):
StringEntryExistsFlag = 2
#
# If the '#string' line and the '#language' line are not in the same line,
# there should be only one line feed character betwwen them
# there should be only one line feed character between them
#
if MultiLineFeedExits:
EdkLogger.Error("Unicode File Parser", ToolError.FORMAT_INVALID, ExtraData=File.Path)
@@ -505,7 +505,7 @@ class UniFileClassObject(object):
MultiLineFeedExits = False
#
# Process comment embeded in string define lines
# Process comment embedded in string define lines
#
FindFlag = Line.find(u'//')
if FindFlag != -1 and Line.find(u'//') < Line.find(u'"'):
@@ -771,7 +771,7 @@ class UniFileClassObject(object):
#
# Check Abstract, Description, BinaryAbstract and BinaryDescription order,
# should be Abstract, Description, BinaryAbstract, BinaryDesctiption
# should be Abstract, Description, BinaryAbstract, BinaryDescription
AbstractPosition = -1
DescriptionPosition = -1
BinaryAbstractPosition = -1