## @file
# Define a dictionary structure
#
# Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
# 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
#
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#
##
# Import Modules
#
import EdkLogger
from DataType import *
## Convert a text file to a dictionary
#
# Convert a text file to a dictionary of (name:value) pairs.
#
# @retval 0 Convert successful
# @retval 1 Open file failed
#
def ConvertTextFileToDictionary(FileName, Dictionary, CommentCharacter, KeySplitCharacter, ValueSplitFlag, ValueSplitCharacter):
try:
Keys = []
for Line in F:
continue
if ValueSplitFlag:
else:
F.close()
return 0
except:
return 1
## Print the dictionary
#
# Print all items of dictionary one by one
#
# @param Dict: The dictionary to be printed
#
if Dict != None:
## Print the dictionary
#
# Print the items of dictionary which matched with input key
#
# @param list: The dictionary to be printed
# @param key: The key of the item to be printed
#
print "\n" + Key
print Item