+ 1#============================================================================
+ 2#Name : api.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""" This module is an helper to interface iMaker. """
+21importos
+22importre
+23importpathaddition.match
+24importfileutils
+25importtempfile
+26importsubprocess
+27
+
41""" Use iMaker to scan the available buildable configurations. """
+42scanner=IMakerConfigScanner()
+43forincinincludes:
+44scanner.add_include(inc)
+45forexcinexcludes:
+46scanner.add_exclude(exc)
+47return[rforrinscanner.scan()]
+
50""" Return the list of target supported by the provided configuration of iMaker. """
+51cmd="imaker -f %s help-target-*-list"%config
+52(_,handle,child_stderr)=os.popen3(cmd)
+53result=[]
+54printchild_stderr.read()
+55forlineinhandle.read().splitlines():
+56line=line.strip()
+57ifline==""orline.startswith("Total duration"):
+58continue
+59result.append(line)
+60handle.close()
+61returnresult
+