BaseTools: Use absolute import in Eot
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:
@ -1,6 +1,7 @@
|
|||||||
# $ANTLR 3.0.1 C.g 2010-02-23 09:58:53
|
# $ANTLR 3.0.1 C.g 2010-02-23 09:58:53
|
||||||
|
|
||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
|
from __future__ import absolute_import
|
||||||
from antlr3 import *
|
from antlr3 import *
|
||||||
from antlr3.compat import set, frozenset
|
from antlr3.compat import set, frozenset
|
||||||
|
|
||||||
@ -23,8 +24,8 @@ from antlr3.compat import set, frozenset
|
|||||||
#
|
#
|
||||||
##
|
##
|
||||||
|
|
||||||
import CodeFragment
|
from . import CodeFragment
|
||||||
import FileProfile
|
from . import FileProfile
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -16,17 +16,18 @@
|
|||||||
# Import Modules
|
# Import Modules
|
||||||
#
|
#
|
||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
|
from __future__ import absolute_import
|
||||||
import re
|
import re
|
||||||
import Common.LongFilePathOs as os
|
import Common.LongFilePathOs as os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
import antlr3
|
import antlr3
|
||||||
from CLexer import CLexer
|
from .CLexer import CLexer
|
||||||
from CParser import CParser
|
from .CParser import CParser
|
||||||
|
|
||||||
import FileProfile
|
from . import FileProfile
|
||||||
from CodeFragment import PP_Directive
|
from .CodeFragment import PP_Directive
|
||||||
from ParserWarning import Warning
|
from .ParserWarning import Warning
|
||||||
|
|
||||||
|
|
||||||
##define T_CHAR_SPACE ' '
|
##define T_CHAR_SPACE ' '
|
||||||
|
@ -14,20 +14,21 @@
|
|||||||
##
|
##
|
||||||
# Import Modules
|
# Import Modules
|
||||||
#
|
#
|
||||||
|
from __future__ import absolute_import
|
||||||
import Common.LongFilePathOs as os, time, glob
|
import Common.LongFilePathOs as os, time, glob
|
||||||
import Common.EdkLogger as EdkLogger
|
import Common.EdkLogger as EdkLogger
|
||||||
import EotGlobalData
|
from . import EotGlobalData
|
||||||
from optparse import OptionParser
|
from optparse import OptionParser
|
||||||
from Common.StringUtils import NormPath
|
from Common.StringUtils import NormPath
|
||||||
from Common import BuildToolError
|
from Common import BuildToolError
|
||||||
from Common.Misc import GuidStructureStringToGuidString, sdict
|
from Common.Misc import GuidStructureStringToGuidString, sdict
|
||||||
from InfParserLite import *
|
from .InfParserLite import *
|
||||||
import c
|
from . import c
|
||||||
import Database
|
from . import Database
|
||||||
from array import array
|
from array import array
|
||||||
from Report import Report
|
from .Report import Report
|
||||||
from Common.BuildVersion import gBUILD_VERSION
|
from Common.BuildVersion import gBUILD_VERSION
|
||||||
from Parser import ConvertGuid
|
from .Parser import ConvertGuid
|
||||||
from Common.LongFilePathSupport import OpenLongFilePath as open
|
from Common.LongFilePathSupport import OpenLongFilePath as open
|
||||||
import struct
|
import struct
|
||||||
import uuid
|
import uuid
|
||||||
@ -153,7 +154,7 @@ class CompressedImage(Image):
|
|||||||
|
|
||||||
def _GetSections(m):
|
def _GetSections(m):
|
||||||
try:
|
try:
|
||||||
import EfiCompressor
|
from . import EfiCompressor
|
||||||
TmpData = EfiCompressor.FrameworkDecompress(
|
TmpData = EfiCompressor.FrameworkDecompress(
|
||||||
m[m._HEADER_SIZE_:],
|
m[m._HEADER_SIZE_:],
|
||||||
len(m) - m._HEADER_SIZE_
|
len(m) - m._HEADER_SIZE_
|
||||||
@ -161,7 +162,7 @@ class CompressedImage(Image):
|
|||||||
DecData = array('B')
|
DecData = array('B')
|
||||||
DecData.fromstring(TmpData)
|
DecData.fromstring(TmpData)
|
||||||
except:
|
except:
|
||||||
import EfiCompressor
|
from . import EfiCompressor
|
||||||
TmpData = EfiCompressor.UefiDecompress(
|
TmpData = EfiCompressor.UefiDecompress(
|
||||||
m[m._HEADER_SIZE_:],
|
m[m._HEADER_SIZE_:],
|
||||||
len(m) - m._HEADER_SIZE_
|
len(m) - m._HEADER_SIZE_
|
||||||
@ -748,7 +749,7 @@ class GuidDefinedImage(Image):
|
|||||||
SectionList.append(Sec)
|
SectionList.append(Sec)
|
||||||
elif Guid == m.TIANO_COMPRESS_GUID:
|
elif Guid == m.TIANO_COMPRESS_GUID:
|
||||||
try:
|
try:
|
||||||
import EfiCompressor
|
from . import EfiCompressor
|
||||||
# skip the header
|
# skip the header
|
||||||
Offset = m.DataOffset - 4
|
Offset = m.DataOffset - 4
|
||||||
TmpData = EfiCompressor.FrameworkDecompress(m[Offset:], len(m)-Offset)
|
TmpData = EfiCompressor.FrameworkDecompress(m[Offset:], len(m)-Offset)
|
||||||
@ -769,7 +770,7 @@ class GuidDefinedImage(Image):
|
|||||||
pass
|
pass
|
||||||
elif Guid == m.LZMA_COMPRESS_GUID:
|
elif Guid == m.LZMA_COMPRESS_GUID:
|
||||||
try:
|
try:
|
||||||
import LzmaCompressor
|
from . import LzmaCompressor
|
||||||
# skip the header
|
# skip the header
|
||||||
Offset = m.DataOffset - 4
|
Offset = m.DataOffset - 4
|
||||||
TmpData = LzmaCompressor.LzmaDecompress(m[Offset:], len(m)-Offset)
|
TmpData = LzmaCompressor.LzmaDecompress(m[Offset:], len(m)-Offset)
|
||||||
|
@ -16,9 +16,10 @@
|
|||||||
# Import Modules
|
# Import Modules
|
||||||
#
|
#
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
import re
|
import re
|
||||||
import Common.LongFilePathOs as os
|
import Common.LongFilePathOs as os
|
||||||
from ParserWarning import Warning
|
from .ParserWarning import Warning
|
||||||
from Common.LongFilePathSupport import OpenLongFilePath as open
|
from Common.LongFilePathSupport import OpenLongFilePath as open
|
||||||
|
|
||||||
# Profile contents of a file
|
# Profile contents of a file
|
||||||
|
@ -15,14 +15,15 @@
|
|||||||
# 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 Common.EdkLogger as EdkLogger
|
import Common.EdkLogger as EdkLogger
|
||||||
from Common.DataType import *
|
from Common.DataType import *
|
||||||
from CommonDataClass.DataClass import *
|
from CommonDataClass.DataClass import *
|
||||||
from Common.Identification import *
|
from Common.Identification import *
|
||||||
from Common.StringUtils import *
|
from Common.StringUtils import *
|
||||||
from Parser import *
|
from .Parser import *
|
||||||
import Database
|
from . import Database
|
||||||
|
|
||||||
## EdkInfParser() class
|
## EdkInfParser() class
|
||||||
#
|
#
|
||||||
|
@ -15,12 +15,13 @@
|
|||||||
##
|
##
|
||||||
# Import Modules
|
# Import Modules
|
||||||
#
|
#
|
||||||
|
from __future__ import absolute_import
|
||||||
import Common.LongFilePathOs as os, re
|
import Common.LongFilePathOs as os, re
|
||||||
import Common.EdkLogger as EdkLogger
|
import Common.EdkLogger as EdkLogger
|
||||||
from Common.DataType import *
|
from Common.DataType import *
|
||||||
from CommonDataClass.DataClass import *
|
from CommonDataClass.DataClass import *
|
||||||
from Common.StringUtils import CleanString, GetSplitValueList, ReplaceMacro
|
from Common.StringUtils import CleanString, GetSplitValueList, ReplaceMacro
|
||||||
import EotGlobalData
|
from . import EotGlobalData
|
||||||
from Common.StringUtils import GetSplitList
|
from Common.StringUtils import GetSplitList
|
||||||
from Common.LongFilePathSupport import OpenLongFilePath as open
|
from Common.LongFilePathSupport import OpenLongFilePath as open
|
||||||
|
|
||||||
|
@ -14,8 +14,9 @@
|
|||||||
##
|
##
|
||||||
# Import Modules
|
# Import Modules
|
||||||
#
|
#
|
||||||
|
from __future__ import absolute_import
|
||||||
import Common.LongFilePathOs as os
|
import Common.LongFilePathOs as os
|
||||||
import EotGlobalData
|
from . import EotGlobalData
|
||||||
from Common.LongFilePathSupport import OpenLongFilePath as open
|
from Common.LongFilePathSupport import OpenLongFilePath as open
|
||||||
|
|
||||||
## Report() class
|
## Report() class
|
||||||
|
@ -16,15 +16,16 @@
|
|||||||
# Import Modules
|
# Import Modules
|
||||||
#
|
#
|
||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
|
from __future__ import absolute_import
|
||||||
import sys
|
import sys
|
||||||
import Common.LongFilePathOs as os
|
import Common.LongFilePathOs as os
|
||||||
import re
|
import re
|
||||||
import CodeFragmentCollector
|
from . import CodeFragmentCollector
|
||||||
import FileProfile
|
from . import FileProfile
|
||||||
from CommonDataClass import DataClass
|
from CommonDataClass import DataClass
|
||||||
from Common import EdkLogger
|
from Common import EdkLogger
|
||||||
from EotToolError import *
|
from .EotToolError import *
|
||||||
import EotGlobalData
|
from . import EotGlobalData
|
||||||
|
|
||||||
# Global Dicts
|
# Global Dicts
|
||||||
IncludeFileListDict = {}
|
IncludeFileListDict = {}
|
||||||
|
Reference in New Issue
Block a user