]> git.proxmox.com Git - mirror_edk2.git/blob - BaseTools/Source/Python/msa2inf/Msa2Inf.py
Sync EDKII BaseTools to BaseTools project r1971
[mirror_edk2.git] / BaseTools / Source / Python / msa2inf / Msa2Inf.py
1 ## @file
2 # Convert an XML-based MSA file to a text-based INF file.
3 #
4 # Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
5 # This program and the accompanying materials
6 # are licensed and made available under the terms and conditions of the BSD License
7 # which accompanies this distribution. The full text of the license may be found at
8 # http://opensource.org/licenses/bsd-license.php
9 #
10 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12 #
13
14 ##
15 # Import Modules
16 #
17 import sys
18 from Common.MigrationUtilities import *
19 from LoadMsa import LoadMsa
20 from StoreInf import StoreInf
21 from ConvertModule import ConvertMsaModuleToInfModule
22
23 ## Entrance method
24 #
25 # This method mainly dispatch specific methods per the command line options.
26 # If no error found, return zero value so the caller of this tool can know
27 # if it's executed successfully or not.
28 #
29 # @retval 0 Tool was successful.
30 # @retval 1 Tool failed.
31 #
32 def Main():
33 try:
34 Options, InputFile = MigrationOptionParser("MSA", "INF", "%prog")
35 Module = LoadMsa(InputFile)
36 ConvertMsaModuleToInfModule(Module)
37 StoreInf(Options.OutputFile, Module)
38 return 0
39 except Exception, e:
40 print e
41 return 1
42
43 if __name__ == '__main__':
44 sys.exit(Main())