From 938cf4c33a0695ef1011b07e455a7ec2f87b5ad3 Mon Sep 17 00:00:00 2001 From: "Carsey, Jaben" Date: Thu, 10 Jan 2019 03:00:41 +0800 Subject: BaseTools: fix imports 1 - Some of these imports are cascaded from another file. Import them locally. 2 - Some of these imports are not used. Remove them. 3 - Some of these were missing the namespace used to import them. These changes facilitate optimization of BaseTools: https://bugzilla.tianocore.org/show_bug.cgi?id=42 Cc: Bob Feng Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey Reviewed-by: Bob Feng --- BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'BaseTools/Source/Python/Ecc') diff --git a/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py b/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py index 52a78bcbb8..283789fd1d 100644 --- a/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py +++ b/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py @@ -40,7 +40,7 @@ from Common.LongFilePathSupport import CodecOpenLongFilePath ## A decorator used to parse macro definition def ParseMacro(Parser): def MacroParser(self): - Match = gMacroDefPattern.match(self._CurrentLine) + Match = GlobalData.gMacroDefPattern.match(self._CurrentLine) if not Match: # Not 'DEFINE/EDK_GLOBAL' statement, call decorated method Parser(self) @@ -61,7 +61,7 @@ def ParseMacro(Parser): EdkLogger.error('Parser', FORMAT_INVALID, "%s can only be defined via environment variable" % Name, ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex+1) # Only upper case letters, digit and '_' are allowed - if not gMacroNamePattern.match(Name): + if not GlobalData.gMacroNamePattern.match(Name): EdkLogger.error('Parser', FORMAT_INVALID, "The macro name must be in the pattern [A-Z][A-Z0-9_]*", ExtraData=self._CurrentLine, File=self.MetaFile, Line=self._LineIndex+1) -- cgit v1.2.3