]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/Common/Dictionary.py
BaseTools: remove local hex number regular expression
[mirror_edk2.git] / BaseTools / Source / Python / Common / Dictionary.py
index de3556b8929a7c94322478c711d70d240596a27f..1c33fefabf986d86db96e95c9cf252d45ec4a026 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # Define a dictionary structure\r
 #\r
-# Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>\r
 # This program and the accompanying materials\r
 # are licensed and made available under the terms and conditions of the BSD License\r
 # which accompanies this distribution.  The full text of the license may be found at\r
@@ -16,6 +16,7 @@
 #\r
 import EdkLogger\r
 from DataType import *\r
+from Common.LongFilePathSupport import OpenLongFilePath as open\r
 \r
 ## Convert a text file to a dictionary\r
 #\r
@@ -26,19 +27,19 @@ from DataType import *
 #\r
 def ConvertTextFileToDictionary(FileName, Dictionary, CommentCharacter, KeySplitCharacter, ValueSplitFlag, ValueSplitCharacter):\r
     try:\r
-        F = open(FileName,'r')\r
+        F = open(FileName, 'r')\r
         Keys = []\r
         for Line in F:\r
             if Line.startswith(CommentCharacter):\r
                 continue\r
-            LineList = Line.split(KeySplitCharacter,1)\r
+            LineList = Line.split(KeySplitCharacter, 1)\r
             if len(LineList) >= 2:\r
                 Key = LineList[0].split()\r
             if len(Key) == 1 and Key[0][0] != CommentCharacter and Key[0] not in Keys:\r
                 if ValueSplitFlag:\r
-                    Dictionary[Key[0]] = LineList[1].replace('\\','/').split(ValueSplitCharacter)\r
+                    Dictionary[Key[0]] = LineList[1].replace('\\', '/').split(ValueSplitCharacter)\r
                 else:\r
-                    Dictionary[Key[0]] = LineList[1].strip().replace('\\','/')\r
+                    Dictionary[Key[0]] = LineList[1].strip().replace('\\', '/')\r
                 Keys += [Key[0]]\r
         F.close()\r
         return 0\r