diff options
author | Dylan Baker <baker.dylan.c@gmail.com> | 2014-07-01 13:48:15 -0700 |
---|---|---|
committer | Dylan Baker <dylanx.c.baker@intel.com> | 2014-09-25 14:18:57 -0700 |
commit | 53503a7ebbb287bfed491f5b79557283136665c7 (patch) | |
tree | dc4e2658068088b317dfbd50959d31cd85398155 | |
parent | 6473bf9e1379a6a075e1b0166931e980112c4e56 (diff) |
log.py: Makes method names clearer
This replace _summary, _running, and _percent with _format*. This makes
the methods easier to understand, especially with names like __summary
also used in the class
v2: - rename _print_* to _format_* (Ilia)
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
-rw-r--r-- | framework/log.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/framework/log.py b/framework/log.py index c9670289c..02b352693 100644 --- a/framework/log.py +++ b/framework/log.py @@ -78,17 +78,17 @@ class Log(object): # newline. sys.stdout.flush() - def _summary(self): + def _format_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 _format_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 _format_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._format_percent(), + running=self._format_running(), + summary=self._format_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._format_percent(), + summary=self._format_summary())) |