]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/Eot/InfParserLite.py
BaseTools: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / BaseTools / Source / Python / Eot / InfParserLite.py
index 88d7e7d58e0bbe022240c83382c8693ccdd2544a..2c6bc50b6cd0ee717ccdab086e69d27cc7364fd2 100644 (file)
@@ -1,14 +1,8 @@
 ## @file\r
 # This file is used to parse INF file of EDK project\r
 #\r
-# Copyright (c) 2008 - 2014, Intel Corporation. All rights reserved.<BR>\r
-# This program and the accompanying materials\r
-# are licensed and made available under the terms and conditions of the BSD License\r
-# which accompanies this distribution.  The full text of the license may be found at\r
-# http://opensource.org/licenses/bsd-license.php\r
-#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+# Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.<BR>\r
+# SPDX-License-Identifier: BSD-2-Clause-Patent\r
 #\r
 \r
 ##\r
 #\r
 from __future__ import print_function\r
 from __future__ import absolute_import\r
+\r
 import Common.LongFilePathOs as os\r
 import Common.EdkLogger as EdkLogger\r
 from Common.DataType import *\r
 from CommonDataClass.DataClass import *\r
-from Common.Identification import *\r
+from Eot.Identification import Identification\r
 from Common.StringUtils import *\r
-from .Parser import *\r
-from . import Database\r
+from Eot.Parser import *\r
+from Eot import Database\r
+from Eot import EotGlobalData\r
 \r
 ## EdkInfParser() class\r
 #\r
@@ -38,11 +34,8 @@ class EdkInfParser(object):
     #  @param  Filename: INF file name\r
     #  @param  Database: Eot database\r
     #  @param  SourceFileList: A list for all source file belonging this INF file\r
-    #  @param  SourceOverridePath: Override path for source file\r
-    #  @param  Edk_Source: Envirnoment variable EDK_SOURCE\r
-    #  @param  Efi_Source: Envirnoment variable EFI_SOURCE\r
     #\r
-    def __init__(self, Filename = None, Database = None, SourceFileList = None, SourceOverridePath = None, Edk_Source = None, Efi_Source = None):\r
+    def __init__(self, Filename = None, Database = None, SourceFileList = None):\r
         self.Identification = Identification()\r
         self.Sources = []\r
         self.Macros = {}\r
@@ -51,7 +44,6 @@ class EdkInfParser(object):
         self.TblFile = Database.TblFile\r
         self.TblInf = Database.TblInf\r
         self.FileID = -1\r
-        self.SourceOverridePath = SourceOverridePath\r
 \r
         # Load Inf file if filename is not None\r
         if Filename is not None:\r
@@ -153,21 +145,4 @@ class EdkInfParser(object):
         self.ParserSource(CurrentSection, SectionItemList, ArchList, ThirdList)\r
         #End of For\r
 \r
-##\r
-#\r
-# This acts like the main() function for the script, unless it is 'import'ed into another\r
-# script.\r
-#\r
-if __name__ == '__main__':\r
-    EdkLogger.Initialize()\r
-    EdkLogger.SetLevel(EdkLogger.QUIET)\r
-\r
-    Db = Database.Database('Inf.db')\r
-    Db.InitDatabase()\r
-    P = EdkInfParser(os.path.normpath("C:\Framework\Edk\Sample\Platform\Nt32\Dxe\PlatformBds\PlatformBds.inf"), Db, '', '')\r
-    for Inf in P.Sources:\r
-        print(Inf)\r
-    for Item in P.Macros:\r
-        print(Item, P.Macros[Item])\r
-\r
-    Db.Close()\r
+\r