Strip epocroot off whatcomp filter output. wip
authortimothy.murphy@nokia.com
Wed, 16 Dec 2009 15:25:49 +0000
branchwip
changeset 114 35ed82e9d574
parent 101 55e6115d31a4
child 115 5869e06bf2ac
Strip epocroot off whatcomp filter output.
sbsv2/raptor/python/plugins/filter_what.py
sbsv2/raptor/python/plugins/filter_whatcomp.py
--- a/sbsv2/raptor/python/plugins/filter_what.py	Mon Dec 14 22:17:56 2009 +0000
+++ b/sbsv2/raptor/python/plugins/filter_what.py	Wed Dec 16 15:25:49 2009 +0000
@@ -22,6 +22,10 @@
 
 class FilterWhat(filter_interface.Filter):
 
+	def __init__(self):
+		super(filter_interface.Filter,self).__init__(self)
+		self.path_prefix_to_strip = None
+		print "HELLO=------"
 	
 	def print_file(self, line, start, end):
 		"Ensure DOS slashes on Windows"
@@ -33,6 +37,10 @@
 			filename = line[(start + 1):end].replace("/","\\")
 		else:
 			filename = line[(start + 1):end]
+
+		if self.path_prefix_to_strip:
+			if filename.startswith(self.path_prefix_to_strip):
+				filename = filename[len(self.path_prefix_to_strip):]
 			
 		if self.check:
 			if not os.path.isfile(filename):
--- a/sbsv2/raptor/python/plugins/filter_whatcomp.py	Mon Dec 14 22:17:56 2009 +0000
+++ b/sbsv2/raptor/python/plugins/filter_whatcomp.py	Wed Dec 16 15:25:49 2009 +0000
@@ -23,11 +23,16 @@
 
 class FilterWhatComp(filter_what.FilterWhat):
 
+        def __init__(self): 
+		super(filter_what.FilterWhat,self).__init__()
+		self.path_prefix_to_strip = os.path.abspath(os.environ["EPOCROOT"])
+
 	def write(self, text):
 		"process some log text"
+		ok = True
 		
 		for line in text.splitlines():
-			ok =filter_what.FilterWhat.write(self, line)
+			ok = filter_what.FilterWhat.write(self, line)
 			if not ok:
 				break