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