[Piglit] [PATCH 06/11] framework: Remove checking for the pre-JSON piglit file format.

Kenneth Graunke kenneth at whitecape.org
Wed Feb 1 16:06:33 PST 2012


It was polite to print a message shortly after the conversion, but at
this point, it's basically dead code.
---
 framework/core.py      |   20 --------------------
 piglit-summary-html.py |    5 +----
 2 files changed, 1 insertions(+), 24 deletions(-)

diff --git a/framework/core.py b/framework/core.py
index 7204914..656847a 100644
--- a/framework/core.py
+++ b/framework/core.py
@@ -50,7 +50,6 @@ __all__ = [
 	'Group',
 	'Test',
 	'testBinDir',
-	'ResultFileInOldFormatError',
 ]
 
 class JSONWriter:
@@ -259,11 +258,6 @@ class GroupResult(dict):
 
 		return root
 
-class ResultFileInOldFormatError(Exception):
-	def __init__(self, filepath):
-		super(Exception, self).__init__(filepath)
-		self.filepath = filepath
-
 class TestrunResult:
 	def __init__(self):
 		self.serialized_keys = [
@@ -278,19 +272,6 @@ class TestrunResult:
 		self.lspci = None
 		self.tests = {}
 
-	def __checkFileIsNotInOldFormat(self, file):
-		'''
-		If file contains the old, custom format, then raise
-		``ResultFileInOldFormatError``.
-
-		:return: None
-		'''
-		saved_position = file.tell()
-		first_line = file.readline()
-		if first_line.startswith('name:'):
-			raise ResultFileInOldFormatError(file.name)
-		file.seek(saved_position)
-
 	def __repairFile(self, file):
 		'''
 		Reapair JSON file if necessary
@@ -365,7 +346,6 @@ class TestrunResult:
 		json.dump(raw_dict, file, indent=JSONWriter.INDENT)
 
 	def parseFile(self, file):
-		self.__checkFileIsNotInOldFormat(file)
 		file = self.__repairFile(file)
 		raw_dict = json.load(file)
 
diff --git a/piglit-summary-html.py b/piglit-summary-html.py
index 56e4449..974ed52 100755
--- a/piglit-summary-html.py
+++ b/piglit-summary-html.py
@@ -326,10 +326,7 @@ def main():
 
 	results = []
 	for result_dir in OptionList:
-		try:
-			results.append(loadresult(result_dir))
-		except core.ResultFileInOldFormatError as e:
-			print('warning: skipping result file because it is in old format, json is now required: file={0}'.format(e.message))
+		results.append(loadresult(result_dir))
 
 	summary = framework.summary.Summary(results)
 	for j in range(len(summary.testruns)):
-- 
1.7.7.6



More information about the Piglit mailing list