BaseTools: Use absolute import in AutoGen

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:37 +08:00 committed by Yonghong Zhu
parent 7de0083812
commit 0ff3b52e06
6 changed files with 23 additions and 17 deletions

View File

@ -16,19 +16,20 @@
## Import Modules ## Import Modules
# #
from __future__ import print_function from __future__ import print_function
from __future__ import absolute_import
import Common.LongFilePathOs as os import Common.LongFilePathOs as os
import re import re
import os.path as path import os.path as path
import copy import copy
import uuid import uuid
import GenC from . import GenC
import GenMake from . import GenMake
import GenDepex from . import GenDepex
from io import BytesIO from io import BytesIO
from StrGather import * from .StrGather import *
from BuildEngine import BuildRule from .BuildEngine import BuildRule
from Common.LongFilePathSupport import CopyLongFilePath from Common.LongFilePathSupport import CopyLongFilePath
from Common.BuildToolError import * from Common.BuildToolError import *
@ -41,14 +42,14 @@ from CommonDataClass.CommonClass import SkuInfoClass
from Workspace.BuildClassObject import * from Workspace.BuildClassObject import *
from GenPatchPcdTable.GenPatchPcdTable import parsePcdInfoFromMapFile from GenPatchPcdTable.GenPatchPcdTable import parsePcdInfoFromMapFile
import Common.VpdInfoFile as VpdInfoFile import Common.VpdInfoFile as VpdInfoFile
from GenPcdDb import CreatePcdDatabaseCode from .GenPcdDb import CreatePcdDatabaseCode
from Workspace.MetaFileCommentParser import UsageList from Workspace.MetaFileCommentParser import UsageList
from Workspace.WorkspaceCommon import GetModuleLibInstances from Workspace.WorkspaceCommon import GetModuleLibInstances
from Common.MultipleWorkspace import MultipleWorkspace as mws from Common.MultipleWorkspace import MultipleWorkspace as mws
import InfSectionParser from . import InfSectionParser
import datetime import datetime
import hashlib import hashlib
from GenVar import VariableMgr, var_info from .GenVar import VariableMgr, var_info
from collections import OrderedDict from collections import OrderedDict
from collections import defaultdict from collections import defaultdict
from Workspace.WorkspaceCommon import OrderedListDict from Workspace.WorkspaceCommon import OrderedListDict

View File

@ -13,6 +13,7 @@
## Import Modules ## Import Modules
# #
from __future__ import absolute_import
import string import string
import collections import collections
import struct import struct
@ -22,9 +23,9 @@ from Common.BuildToolError import *
from Common.DataType import * from Common.DataType import *
from Common.Misc import * from Common.Misc import *
from Common.StringUtils import StringToArray from Common.StringUtils import StringToArray
from StrGather import * from .StrGather import *
from GenPcdDb import CreatePcdDatabaseCode from .GenPcdDb import CreatePcdDatabaseCode
from IdfClassObject import * from .IdfClassObject import *
## PCD type string ## PCD type string
gItemTypeStringDatabase = { gItemTypeStringDatabase = {

View File

@ -13,6 +13,7 @@
## Import Modules ## Import Modules
# #
from __future__ import absolute_import
import Common.LongFilePathOs as os import Common.LongFilePathOs as os
import sys import sys
import string import string
@ -23,7 +24,7 @@ from Common.MultipleWorkspace import MultipleWorkspace as mws
from Common.BuildToolError import * from Common.BuildToolError import *
from Common.Misc import * from Common.Misc import *
from Common.StringUtils import * from Common.StringUtils import *
from BuildEngine import * from .BuildEngine import *
import Common.GlobalData as GlobalData import Common.GlobalData as GlobalData
from collections import OrderedDict from collections import OrderedDict

View File

@ -10,13 +10,14 @@
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# #
from __future__ import absolute_import
from io import BytesIO from io import BytesIO
from Common.Misc import * from Common.Misc import *
from Common.StringUtils import StringToArray from Common.StringUtils import StringToArray
from struct import pack from struct import pack
from ValidCheckingInfoObject import VAR_CHECK_PCD_VARIABLE_TAB_CONTAINER from .ValidCheckingInfoObject import VAR_CHECK_PCD_VARIABLE_TAB_CONTAINER
from ValidCheckingInfoObject import VAR_CHECK_PCD_VARIABLE_TAB from .ValidCheckingInfoObject import VAR_CHECK_PCD_VARIABLE_TAB
from ValidCheckingInfoObject import GetValidationObject from .ValidCheckingInfoObject import GetValidationObject
from Common.VariableAttributes import VariableAttributes from Common.VariableAttributes import VariableAttributes
import copy import copy
from struct import unpack from struct import unpack

View File

@ -13,6 +13,7 @@
## ##
# Import Modules # Import Modules
# #
from __future__ import absolute_import
import Common.EdkLogger as EdkLogger import Common.EdkLogger as EdkLogger
from Common.BuildToolError import * from Common.BuildToolError import *
from Common.StringUtils import GetLineNo from Common.StringUtils import GetLineNo
@ -21,7 +22,7 @@ from Common.LongFilePathSupport import LongFilePath
import re import re
import os import os
from Common.GlobalData import gIdentifierPattern from Common.GlobalData import gIdentifierPattern
from UniClassObject import StripComments from .UniClassObject import StripComments
IMAGE_TOKEN = re.compile('IMAGE_TOKEN *\(([A-Z0-9_]+) *\)', re.MULTILINE | re.UNICODE) IMAGE_TOKEN = re.compile('IMAGE_TOKEN *\(([A-Z0-9_]+) *\)', re.MULTILINE | re.UNICODE)

View File

@ -14,10 +14,11 @@
## ##
# Import Modules # Import Modules
# #
from __future__ import absolute_import
import re import re
import Common.EdkLogger as EdkLogger import Common.EdkLogger as EdkLogger
from Common.BuildToolError import * from Common.BuildToolError import *
from UniClassObject import * from .UniClassObject import *
from io import BytesIO from io import BytesIO
from struct import pack, unpack from struct import pack, unpack
from Common.LongFilePathSupport import OpenLongFilePath as open from Common.LongFilePathSupport import OpenLongFilePath as open