[Piglit] [RFC 2/9] results.py: remove serialized keys
Dylan Baker
baker.dylan.c at gmail.com
Mon Apr 6 14:30:12 PDT 2015
This value makes sense for the json output, but wont be used in future
patches, so just get rid of it.
Signed-off-by: Dylan Baker <dylanx.c.baker at intel.com>
---
framework/results.py | 15 +++------------
1 file changed, 3 insertions(+), 12 deletions(-)
diff --git a/framework/results.py b/framework/results.py
index 5373e34..7e5de48 100644
--- a/framework/results.py
+++ b/framework/results.py
@@ -103,15 +103,6 @@ class TestResult(dict):
class TestrunResult(object):
def __init__(self):
- self.serialized_keys = ['options',
- 'name',
- 'tests',
- 'uname',
- 'wglinfo',
- 'glxinfo',
- 'lspci',
- 'results_version',
- 'time_elapsed']
self.name = None
self.uname = None
self.options = None
@@ -123,10 +114,10 @@ class TestrunResult(object):
self.tests = {}
def write(self, file_):
- """ Write only values of the serialized_keys out to file """
+ """Write the result json."""
with open(file_, 'w') as f:
- json.dump(dict((k, v) for k, v in self.__dict__.iteritems()
- if k in self.serialized_keys),
+ json.dump({k: v for k, v in self.__dict__.iteritems() if not
+ k.startswith('_')},
f, default=piglit_encoder, indent=JSONBackend.INDENT)
@classmethod
--
2.3.5
More information about the Piglit
mailing list