buildframework/helium/tools/relnotes/icf2txt.py
changeset 217 0f5e3a7fb6af
parent 181 59bb7c4d6172
child 307 22ecbfc20eb4
child 584 56dd7656a965
child 587 85df38eb4012
equal deleted inserted replaced
181:59bb7c4d6172 217:0f5e3a7fb6af
     1 #============================================================================ 
       
     2 #Name        : icf2txt.py 
       
     3 #Part of     : Helium 
       
     4 
       
     5 #Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     6 #All rights reserved.
       
     7 #This component and the accompanying materials are made available
       
     8 #under the terms of the License "Eclipse Public License v1.0"
       
     9 #which accompanies this distribution, and is available
       
    10 #at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
    11 #
       
    12 #Initial Contributors:
       
    13 #Nokia Corporation - initial contribution.
       
    14 #
       
    15 #Contributors:
       
    16 #
       
    17 #Description:
       
    18 #===============================================================================
       
    19 
       
    20 import sys
       
    21 import amara
       
    22 
       
    23 def main():
       
    24     if len(sys.argv) != 3:
       
    25         print "Usage: icf2txt.py bom.xml out.txt"
       
    26         sys.exit(1)
       
    27 
       
    28     bomxmlFile = open(sys.argv[1], "r")
       
    29     outFile = open(sys.argv[2], "w")
       
    30     
       
    31     bomxml = amara.parse(bomxmlFile)
       
    32     
       
    33     if hasattr(bomxml.bom.content.project, "icf"):
       
    34         for icf in bomxml.bom.content.project.icf:
       
    35             outFile.write(str(icf) + "\n")
       
    36 
       
    37     outFile.close()
       
    38     bomxmlFile.close()
       
    39 
       
    40 if __name__ == "__main__":
       
    41     main()