diff -r c7c26511138f -r 7c4a911dc066 buildframework/helium/tools/common/python/scripts/sbsscanlogmetadata.py --- a/buildframework/helium/tools/common/python/scripts/sbsscanlogmetadata.py Wed Jun 16 16:51:40 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,150 +0,0 @@ -#============================================================================ -#Name : sbsscanlogmetadata.py -#Part of : Helium - -#Copyright (c) 2009 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" -#which accompanies this distribution, and is available -#at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -#Initial Contributors: -#Nokia Corporation - initial contribution. -# -#Contributors: -# -#Description: -#=============================================================================== -"""parses the raptor metadata logs and separates the info out into HTML and XML - logs for writing to diamonds and other logs""" - -import os -import sys -import re -import datetime -from optparse import OptionParser - - -IGNORE_TEXT_REG_EX = "warning: no newline at end of file" - -STREAM_REGEX = { "clean" : [r' -""") - for searchString in STREAM_REGEX[stream]: - self.compiled_stream_object[stream].append(re.compile(searchString)) - return True - - def open(self, logFile): - """ open the log file""" - self.logFileName = str(logFile) - return self.initialize(logFile) - - - def write(self, text): - """ callback function which is to process the logs""" - stream_list = STREAM_REGEX.keys() - for textLine in text.splitlines(): - textLine = textLine + '\n' - if textLine.startswith("') - self.streams[stream].close() - return True - except: - self.loggerout = None - self.streams = None - return False - -if __name__ == "__main__": - # standalone app - _cli = OptionParser(usage="%prog [options]") - _cli.add_option("--log", help="Raptor log file") - _cli.add_option("--output", help="Raptor log file") - - _opts, _ = _cli.parse_args() - if not _opts.log: - _cli.print_help() - sys.exit(-1) - - _sbsFilter = SBSScanlogMetadata() - _sbsFilter.open(_opts.output) - - _logFile = open(_opts.log, 'r') - - for line in _logFile: - _sbsFilter.write(line) - - _sbsFilter.summary() - _sbsFilter.close() \ No newline at end of file