]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/Eot/InfParserLite.py
BaseTools: Use absolute import in Eot
[mirror_edk2.git] / BaseTools / Source / Python / Eot / InfParserLite.py
index 6750f5a0c9673d63b665f695d123cd347a948b7c..88d7e7d58e0bbe022240c83382c8693ccdd2544a 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # This file is used to parse INF file of EDK project\r
 #\r
-# Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.<BR>\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
 ##\r
 # Import Modules\r
 #\r
-import os\r
+from __future__ import print_function\r
+from __future__ import absolute_import\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 Common.String import *\r
-from Parser import *\r
-import Database\r
+from Common.StringUtils import *\r
+from .Parser import *\r
+from . import Database\r
 \r
 ## EdkInfParser() class\r
 #\r
@@ -52,7 +54,7 @@ class EdkInfParser(object):
         self.SourceOverridePath = SourceOverridePath\r
 \r
         # Load Inf file if filename is not None\r
-        if Filename != None:\r
+        if Filename is not None:\r
             self.LoadInfFile(Filename)\r
 \r
         if SourceFileList:\r
@@ -164,8 +166,8 @@ if __name__ == '__main__':
     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
+        print(Inf)\r
     for Item in P.Macros:\r
-        print Item, P.Macros[Item]\r
+        print(Item, P.Macros[Item])\r
 \r
-    Db.Close()
\ No newline at end of file
+    Db.Close()\r