[Piglit] [PATCH 3/5] log.py: Makes method names clearer

Dylan Baker baker.dylan.c at gmail.com
Thu Jul 3 13:56:17 PDT 2014


This replace _summary, _running, and _percent with _print*. This makes
the methods easier to understand, especially with names like __summary
also used in the class

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

diff --git a/framework/log.py b/framework/log.py
index c967028..d6ab735 100644
--- a/framework/log.py
+++ b/framework/log.py
@@ -78,17 +78,17 @@ class Log(object):
         # newline.
         sys.stdout.flush()
 
-    def _summary(self):
+    def _print_summary(self):
         """ return a summary of the statuses """
         return ", ".join("{0}: {1}".format(k, self.__summary[k])
                          for k in sorted(self.__summary))
 
-    def _running(self):
+    def _print_running(self):
         """ return running tests """
         return "Running Test(s): {}".format(
             " ".join([str(x).zfill(self.__pad) for x in self.__running]))
 
-    def _percent(self):
+    def _print_percent(self):
         """ return the percentage of tess completed """
         return "{0}/{1}".format(str(self.__complete).zfill(self.__pad),
                                 str(self.__total).zfill(self.__pad))
@@ -96,9 +96,9 @@ 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(),
+            percent=self._print_percent(),
+            running=self._print_running(),
+            summary=self._print_summary(),
             name=name,
             result=result))
 
@@ -149,5 +149,5 @@ class Log(object):
 
     def summary(self):
         self._write_output(self.__summary_output.format(
-            percent=self._percent(),
-            summary=self._summary()))
+            percent=self._print_percent(),
+            summary=self._print_summary()))
-- 
2.0.0



More information about the Piglit mailing list