[Piglit] [PATCH 2/5] framework/log.py: Use keyword args to format instead of splat

Dylan Baker baker.dylan.c at gmail.com
Tue Aug 19 14:21:04 PDT 2014


From: Dylan Baker <baker.dylan.c at gmail.com>

Using splat with a dictionary makes sense when the dictionary is already
available (like with locals()), but it isn't very clear.

Signed-off-by: Dylan Baker <dylanx.c.baker at intel.com>
---
 framework/log.py | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/framework/log.py b/framework/log.py
index 97afeb1..c967028 100644
--- a/framework/log.py
+++ b/framework/log.py
@@ -95,11 +95,12 @@ class Log(object):
 
     def __print(self, name, result):
         """ Do the actual printing """
-        self._write_output(self.__output.format(**{'percent': self._percent(),
-                                                   'running': self._running(),
-                                                   'summary': self._summary(),
-                                                   'name': name,
-                                                   'result': result}))
+        self._write_output(self.__output.format(
+            percent=self._percent(),
+            running=self._running(),
+            summary=self._summary(),
+            name=name,
+            result=result))
 
     @synchronized_self
     def log(self, name, result, value):
@@ -147,5 +148,6 @@ class Log(object):
         return x
 
     def summary(self):
-        self._write_output(self.__summary_output.format(**{'percent': self._percent(),
-                                                           'summary': self._summary()}))
+        self._write_output(self.__summary_output.format(
+            percent=self._percent(),
+            summary=self._summary()))
-- 
2.0.4



More information about the Piglit mailing list