BaseTools: UPT: remove unused variable and inaccessible code.
authorCarsey, Jaben </o=Intel/ou=Americas01/cn=Workers/cn=Carsey, Jaben>
Mon, 12 Mar 2018 14:24:56 +0000 (22:24 +0800)
committerYonghong Zhu <yonghong.zhu@intel.com>
Thu, 15 Mar 2018 06:50:15 +0000 (14:50 +0800)
gINCLUDE_PATTERN is never used.
IncList is always empty.

Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
BaseTools/Source/Python/UPT/Library/UniClassObject.py

index 1fbbf2e..0014a75 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # Collect all defined strings in multiple uni files.\r
 #\r
-# Copyright (c) 2014 - 2017, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2014 - 2018, Intel Corporation. All rights reserved.<BR>\r
 #\r
 # This program and the accompanying materials are licensed and made available \r
 # under the terms and conditions of the BSD License which accompanies this \r
@@ -47,8 +47,6 @@ NULL = u'\u0000'
 TAB = u'\t'\r
 BACK_SPLASH = u'\\'\r
 \r
-gINCLUDE_PATTERN = re.compile("^!include[\s]+([\S]+)[\s]*$", re.MULTILINE | re.UNICODE)\r
-\r
 gLANG_CONV_TABLE = {'eng':'en', 'fra':'fr', \\r
                  'aar':'aa', 'abk':'ab', 'ave':'ae', 'afr':'af', 'aka':'ak', 'amh':'am', \\r
                  'arg':'an', 'ara':'ar', 'asm':'as', 'ava':'av', 'aym':'ay', 'aze':'az', \\r
@@ -543,22 +541,6 @@ class UniFileClassObject(object):
             Line = Line.replace(u'\t', u' ')\r
             Line = Line.replace(u'\u0006', u'\\')\r
 \r
-            # IncList = gINCLUDE_PATTERN.findall(Line)\r
-            IncList = []\r
-            if len(IncList) == 1:\r
-                for Dir in [File.Dir] + self.IncludePathList:\r
-                    IncFile = PathClass(str(IncList[0]), Dir)\r
-                    self.IncFileList.append(IncFile)\r
-                    if os.path.isfile(IncFile.Path):\r
-                        Lines.extend(self.PreProcess(IncFile, True))\r
-                        break\r
-                else:\r
-                    EdkLogger.Error("Unicode File Parser", \r
-                                    ToolError.FILE_NOT_FOUND, \r
-                                    Message="Cannot find include file", \r
-                                    ExtraData=str(IncList[0]))\r
-                continue\r
-\r
             #\r
             # Check if single line has correct '"'\r
             #\r