BaseTools: Use absolute import in Common

Based on "futurize -f libfuturize.fixes.fix_absolute_import

Contributed-under: TianoCore Contribution Agreement 1.1
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Gary Lin <glin@suse.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
This commit is contained in:
Gary Lin 2018-07-13 18:18:40 +08:00 committed by Yonghong Zhu
parent 72a836c00a
commit f3fc5b47ad
9 changed files with 33 additions and 25 deletions

View File

@ -14,13 +14,14 @@
##
# Import Modules
#
from __future__ import absolute_import
import sqlite3
import Common.LongFilePathOs as os
import EdkLogger as EdkLogger
from . import EdkLogger as EdkLogger
from CommonDataClass.DataClass import *
from StringUtils import *
from DataType import *
from .StringUtils import *
from .DataType import *
from Table.TableDataModel import TableDataModel
from Table.TableFile import TableFile
@ -117,4 +118,3 @@ if __name__ == '__main__':
Db.QueryTable(Db.TblFile)
Db.QueryTable(Db.TblDsc)
Db.Close()

View File

@ -12,9 +12,10 @@
#
## Import modules
from __future__ import absolute_import
import Common.LongFilePathOs as os, sys, logging
import traceback
from BuildToolError import *
from .BuildToolError import *
## Log level constants
DEBUG_0 = 1

View File

@ -13,10 +13,11 @@
## Import Modules
#
from __future__ import print_function
from __future__ import absolute_import
from Common.GlobalData import *
from CommonDataClass.Exceptions import BadExpression
from CommonDataClass.Exceptions import WrnExpression
from Misc import GuidStringToGuidStructureString, ParseFieldValue, IsFieldValueAnArray
from .Misc import GuidStringToGuidStructureString, ParseFieldValue, IsFieldValueAnArray
import Common.EdkLogger as EdkLogger
import copy
from Common.DataType import *

View File

@ -11,8 +11,9 @@
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#
from __future__ import absolute_import
import os
import LongFilePathOsPath
from . import LongFilePathOsPath
from Common.LongFilePathSupport import LongFilePath
from Common.LongFilePathSupport import UniToStr
import time

View File

@ -14,6 +14,7 @@
##
# Import Modules
#
from __future__ import absolute_import
import Common.LongFilePathOs as os
import sys
import string
@ -30,10 +31,10 @@ from UserList import UserList
from Common import EdkLogger as EdkLogger
from Common import GlobalData as GlobalData
from DataType import *
from BuildToolError import *
from .DataType import *
from .BuildToolError import *
from CommonDataClass.DataClass import *
from Parsing import GetSplitValueList
from .Parsing import GetSplitValueList
from Common.LongFilePathSupport import OpenLongFilePath as open
from Common.MultipleWorkspace import MultipleWorkspace as mws
import uuid
@ -474,7 +475,7 @@ def SaveFileOnChange(File, Content, IsBinaryFile=True):
try:
if GlobalData.gIsWindows:
try:
from PyUtility import SaveFileToDisk
from .PyUtility import SaveFileToDisk
if not SaveFileToDisk(File, Content):
EdkLogger.error(None, FILE_CREATE_FAILURE, ExtraData=File)
except:

View File

@ -14,9 +14,10 @@
##
# Import Modules
#
from StringUtils import *
from __future__ import absolute_import
from .StringUtils import *
from CommonDataClass.DataClass import *
from DataType import *
from .DataType import *
## ParseDefineMacro
#

View File

@ -14,14 +14,15 @@
##
# Import Modules
#
from __future__ import absolute_import
import re
import DataType
from . import DataType
import Common.LongFilePathOs as os
import string
import EdkLogger as EdkLogger
from . import EdkLogger as EdkLogger
import GlobalData
from BuildToolError import *
from . import GlobalData
from .BuildToolError import *
from CommonDataClass.Exceptions import *
from Common.LongFilePathSupport import OpenLongFilePath as open
from Common.MultipleWorkspace import MultipleWorkspace as mws

View File

@ -15,11 +15,12 @@
# Import Modules
#
from __future__ import print_function
from __future__ import absolute_import
import Common.LongFilePathOs as os
import EdkLogger
import DataType
from BuildToolError import *
import GlobalData
from . import EdkLogger
from . import DataType
from .BuildToolError import *
from . import GlobalData
from Common.LongFilePathSupport import OpenLongFilePath as open
gDefaultTargetTxtFile = "target.txt"

View File

@ -14,19 +14,20 @@
##
# Import Modules
#
from __future__ import absolute_import
import Common.LongFilePathOs as os
import re
import EdkLogger
from . import EdkLogger
from BuildToolError import *
from TargetTxtClassObject import *
from .BuildToolError import *
from .TargetTxtClassObject import *
from Common.LongFilePathSupport import OpenLongFilePath as open
from Common.Misc import PathClass
from Common.StringUtils import NormPath
import Common.GlobalData as GlobalData
from Common import GlobalData
from Common.MultipleWorkspace import MultipleWorkspace as mws
from DataType import TAB_TOD_DEFINES_TARGET, TAB_TOD_DEFINES_TOOL_CHAIN_TAG,\
from .DataType import TAB_TOD_DEFINES_TARGET, TAB_TOD_DEFINES_TOOL_CHAIN_TAG,\
TAB_TOD_DEFINES_TARGET_ARCH, TAB_TOD_DEFINES_COMMAND_TYPE\
, TAB_TOD_DEFINES_FAMILY, TAB_TOD_DEFINES_BUILDRULEFAMILY