diff -r 7ae5f757318b -r 37ee82a83d43 sbsv2/raptor/python/filter_interface.py --- a/sbsv2/raptor/python/filter_interface.py Tue Nov 02 16:54:53 2010 +0800 +++ b/sbsv2/raptor/python/filter_interface.py Fri Nov 12 14:49:36 2010 +0000 @@ -1,5 +1,5 @@ # -# Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). +# Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies). # All rights reserved. # This component and the accompanying materials are made available # under the terms of the License "Eclipse Public License v1.0" @@ -36,6 +36,53 @@ def formatWarning(self, message): return "sbs: warning: " + message + "\n" + def parseNamedParams(self, names, params): + ''' Match named parameters e.g. ['a=b','c=d'] against a list of expected + names. Allow for abbreviations. + ''' + r = {} + + # Shorten all the names so they match abbreviations + shortnames = [] + + for name in names: + shortname = "" + conflict = True + while len(shortname) tag in {1} recipe for {2}".format(name, self.formatData('name'), self.formatData('target')))) + + def endElement(self, name): + if name == "recipe": + if not self.inRecipe: + self.error(RaptorLogNotValid("Extra recipe close tag")) + else: + if not self.handleRecipe(): + self.error(RaptorLogNotValid('Handling of {0} recipe for {1} failed'.format(self.formatData('name'), self.formatData('target')))) + self.inRecipe = False + + self.__delData(self.recipeData|self.statusData|self.timeData) + self.text="" + + def characters(self, char): + if self.inRecipe: + self.text += char + + def error(self, exception): + "the parse found an error which is (possibly) recoverable" + pass + + def fatalError(self, exception): + "the parser thinks an error occurred which should stop everything" + pass + + def warning(self, exception): + "the parser found something to complain about that might not matter" + pass + + # Private methods + def __setHashElements(self, fro, to, keys): + for key in keys: + if fro.has_key(key): + to[key] = fro[key] + + def __delData(self, keys): + for key in keys: + if self.__dict__.has_key(key): + del self.__dict__[key] # the end