X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=BaseTools%2FSource%2FPython%2FEot%2FParser.py;h=e01a9770befbc7d3340d79c41e153b67571184ae;hp=deea6fb947c87364cbad4a328f751b4353bbd528;hb=64429fbd61d445b892a78f4e55b0b83c184790bd;hpb=b36d134faf4305247830522b8e2bb255e98c5699 diff --git a/BaseTools/Source/Python/Eot/Parser.py b/BaseTools/Source/Python/Eot/Parser.py index deea6fb947..e01a9770be 100644 --- a/BaseTools/Source/Python/Eot/Parser.py +++ b/BaseTools/Source/Python/Eot/Parser.py @@ -2,7 +2,7 @@ # This file is used to define common parsing related functions used in parsing # Inf/Dsc/Makefile process # -# Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.
+# Copyright (c) 2008 - 2014, Intel Corporation. All rights reserved.
# This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License # which accompanies this distribution. The full text of the license may be found at @@ -15,13 +15,15 @@ ## # Import Modules # -import os, re +from __future__ import absolute_import +import Common.LongFilePathOs as os, re import Common.EdkLogger as EdkLogger from Common.DataType import * from CommonDataClass.DataClass import * -from Common.String import CleanString, GetSplitValueList, ReplaceMacro -import EotGlobalData -from Common.Misc import sdict +from Common.StringUtils import CleanString, GetSplitValueList, ReplaceMacro +from . import EotGlobalData +from Common.StringUtils import GetSplitList +from Common.LongFilePathSupport import OpenLongFilePath as open ## PreProcess() method # @@ -50,10 +52,10 @@ def PreProcess(Filename, MergeMultipleLines = True, LineNo = -1): Line = Line.strip() # Remove comment block if Line.find(TAB_COMMENT_EDK_START) > -1: - ReservedLine = GetSplitValueList(Line, TAB_COMMENT_EDK_START, 1)[0] + ReservedLine = GetSplitList(Line, TAB_COMMENT_EDK_START, 1)[0] IsFindBlockComment = True if Line.find(TAB_COMMENT_EDK_END) > -1: - Line = ReservedLine + GetSplitValueList(Line, TAB_COMMENT_EDK_END, 1)[1] + Line = ReservedLine + GetSplitList(Line, TAB_COMMENT_EDK_END, 1)[1] ReservedLine = '' IsFindBlockComment = False if IsFindBlockComment: @@ -621,7 +623,7 @@ def SearchProtocols(SqlCommand, Table, SourceFileID, SourceFileFullPath, ItemMod # @param ItemMode: Mode of item # def SearchFunctionCalling(Table, SourceFileID, SourceFileFullPath, ItemType, ItemMode): - LibraryList = sdict() + LibraryList = {} Db = EotGlobalData.gDb.TblReport Parameters, ItemName, GuidName, GuidMacro, GuidValue, BelongsToFunction = [], '', '', '', '', '' if ItemType == 'Protocol' and ItemMode == 'Produced': @@ -729,7 +731,7 @@ def GetParameter(Parameter, Index = 1): # @return: The name of parameter # def GetParameterName(Parameter): - if type(Parameter) == type('') and Parameter.startswith('&'): + if isinstance(Parameter, type('')) and Parameter.startswith('&'): return Parameter[1:].replace('{', '').replace('}', '').replace('\r', '').replace('\n', '').strip() else: return Parameter.strip()