]> git.proxmox.com Git - mirror_edk2.git/blob - BaseTools/Source/Python/spd2dec/Spd2Dec.py
Check In tool source code based on Build tool project revision r1655.
[mirror_edk2.git] / BaseTools / Source / Python / spd2dec / Spd2Dec.py
1 ## @file
2 # Convert an XML-based SPD file to a text-based DEC file.
3 #
4 # Copyright (c) 2007, Intel Corporation
5 # All rights reserved. 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 LoadSpd import LoadSpd
20 from StoreDec import StoreDec
21 from ConvertPackage import ConvertSpdPackageToDecPackage
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("SPD", "DEC", "%prog")
35 Package = LoadSpd(InputFile)
36 ConvertSpdPackageToDecPackage(Package)
37 StoreDec(Options.OutputFile, Package)
38 return 0
39 except Exception, e:
40 print e
41 return 1
42
43 if __name__ == '__main__':
44 sys.exit(Main())
45
46