- try:\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
- 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
- else:\r
- Dictionary[Key[0]] = LineList[1].strip().replace('\\','/')\r
- Keys += [Key[0]]\r
- F.close()\r
- return 0\r
- except:\r
- EdkLogger.info('Open file failed')\r
- return 1\r
+ try:\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
+ 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
+ else:\r
+ Dictionary[Key[0]] = LineList[1].strip().replace('\\', '/')\r
+ Keys += [Key[0]]\r
+ F.close()\r
+ return 0\r
+ except:\r
+ EdkLogger.info('Open file failed')\r
+ return 1\r