X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=BaseTools%2FSource%2FPython%2FCommon%2FDictionary.py;h=1c33fefabf986d86db96e95c9cf252d45ec4a026;hb=b1a9e404d4e91729b99d690fa849451269dd3a47;hp=de3556b8929a7c94322478c711d70d240596a27f;hpb=08dd311f5dc735c595d39faf2e6f7e2810bb79a9;p=mirror_edk2.git diff --git a/BaseTools/Source/Python/Common/Dictionary.py b/BaseTools/Source/Python/Common/Dictionary.py index de3556b892..1c33fefabf 100644 --- a/BaseTools/Source/Python/Common/Dictionary.py +++ b/BaseTools/Source/Python/Common/Dictionary.py @@ -1,7 +1,7 @@ ## @file # Define a dictionary structure # -# Copyright (c) 2007, Intel Corporation. All rights reserved.
+# Copyright (c) 2007 - 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 @@ -16,6 +16,7 @@ # import EdkLogger from DataType import * +from Common.LongFilePathSupport import OpenLongFilePath as open ## Convert a text file to a dictionary # @@ -26,19 +27,19 @@ from DataType import * # def ConvertTextFileToDictionary(FileName, Dictionary, CommentCharacter, KeySplitCharacter, ValueSplitFlag, ValueSplitCharacter): try: - F = open(FileName,'r') + F = open(FileName, 'r') Keys = [] for Line in F: if Line.startswith(CommentCharacter): continue - LineList = Line.split(KeySplitCharacter,1) + LineList = Line.split(KeySplitCharacter, 1) if len(LineList) >= 2: Key = LineList[0].split() if len(Key) == 1 and Key[0][0] != CommentCharacter and Key[0] not in Keys: if ValueSplitFlag: - Dictionary[Key[0]] = LineList[1].replace('\\','/').split(ValueSplitCharacter) + Dictionary[Key[0]] = LineList[1].replace('\\', '/').split(ValueSplitCharacter) else: - Dictionary[Key[0]] = LineList[1].strip().replace('\\','/') + Dictionary[Key[0]] = LineList[1].strip().replace('\\', '/') Keys += [Key[0]] F.close() return 0