## @file
# This file is used to define each component of Target.txt file
#
# Copyright (c) 2007 - 2010, 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 os
import EdkLogger
import DataType
from BuildToolError import *
import GlobalData
## TargetTxtClassObject
#
# This class defined content used in file target.txt
#
# @param object: Inherited from object class
# @param Filename: Input value for full path of target.txt
#
# @var TargetTxtDictionary: To store keys and values defined in target.txt
#
}
if Filename != None:
## LoadTargetTxtFile
#
# Load target.txt file and parse it, return a set structure to store keys and values
#
# @param Filename: Input value for full path of target.txt
#
# @retval set() A set structure to store keys and values
# @retval 1 Error happenes in parsing
#
else:
return 1
## ConvertTextFileToDict
#
# Convert a text file to a dictionary of (name:value) pairs.
# The data is saved to self.TargetTxtDictionary
#
# @param FileName: Text filename
# @param CommentCharacter: Comment char, be used to ignore comment content
# @param KeySplitCharacter: Key split char, between key name and key value. Key1 = Value1, '=' is the key split char
#
# @retval 0 Convert successfully
# @retval 1 Open file failed
#
F = None
try:
except:
if F != None:
F.close()
for Line in F:
continue
else:
Value = ""
try:
except:
#elif Key not in GlobalData.gGlobalDefines:
# GlobalData.gGlobalDefines[Key] = Value
F.close()
return 0
## 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
## TargetTxtDict
#
# Load target.txt in input workspace dir
#
# @param WorkSpace: Workspace dir
#
# @retval Target An instance of TargetTxtClassObject() with loaded target.txt
#
# VBox begin
else:
# VBox end
return Target
##
#
# This acts like the main() function for the script, unless it is 'import'ed into another
# script.
#
if __name__ == '__main__':
pass
print Target.TargetTxtDictionary