From: Ondrej Lichtner olichtne@redhat.com
No reason to use a short hand... the object will accept multiline descriptions anyway and the SummaryFormatter should be able to deal with that.
Signed-off-by: Ondrej Lichtner olichtne@redhat.com --- lnst/Controller/RecipeResults.py | 20 ++++++++++---------- lnst/Controller/RunSummaryFormatter.py | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/lnst/Controller/RecipeResults.py b/lnst/Controller/RecipeResults.py index 05ce5fb..d19d6e8 100644 --- a/lnst/Controller/RecipeResults.py +++ b/lnst/Controller/RecipeResults.py @@ -38,7 +38,7 @@ class BaseResult(object): return self._success
@property - def short_desc(self): + def description(self): return "Short description of result if relevant"
@property @@ -76,8 +76,8 @@ class JobResult(BaseResult):
class JobStartResult(JobResult): """Generated automatically when a Job is succesfully started on a slave""" - @BaseResult.short_desc.getter - def short_desc(self): + @BaseResult.description.getter + def description(self): return "Job started: {}".format(str(self.job))
class JobFinishResult(JobResult): @@ -92,8 +92,8 @@ class JobFinishResult(JobResult): def success(self): return self._job.passed
- @BaseResult.short_desc.getter - def short_desc(self): + @BaseResult.description.getter + def description(self): return "Job finished: {}".format(str(self.job))
@BaseResult.data.getter @@ -105,11 +105,11 @@ class Result(BaseResult):
Will be created when the tester calls the Recipe interface for adding results.""" - def __init__(self, success, short_desc="", data=None, + def __init__(self, success, description="", data=None, level=None, data_level=None): super(Result, self).__init__(success)
- self._short_desc = short_desc + self._description = description self._data = data self._level = (level if isinstance(level, ResultLevel) @@ -118,9 +118,9 @@ class Result(BaseResult): if isinstance(data_level, ResultLevel) else ResultLevel.IMPORTANT+1)
- @BaseResult.short_desc.getter - def short_desc(self): - return self._short_desc + @BaseResult.description.getter + def description(self): + return self._description
@BaseResult.data.getter def data(self): diff --git a/lnst/Controller/RunSummaryFormatter.py b/lnst/Controller/RunSummaryFormatter.py index a90efe4..ea9a6dd 100644 --- a/lnst/Controller/RunSummaryFormatter.py +++ b/lnst/Controller/RunSummaryFormatter.py @@ -105,7 +105,7 @@ class RunSummaryFormatter(object): output_lines.append("{res} {src}\t{desc}".format( res = self._format_success(res.success), src = self._format_source(res), - desc = res.short_desc)) + desc = res.description)
if res.data_level <= self._level: output_lines.extend(self._format_data(res.data))