On Monday, April 28, 2014 11:56:52 Thomas Wood wrote: > v2: update for the changes to the test result template and check for None > in the summary index time value > > Signed-off-by: Thomas Wood <[email protected]> > --- > framework/summary.py | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/framework/summary.py b/framework/summary.py > index 9228330..62e543f 100644 > --- a/framework/summary.py > +++ b/framework/summary.py > @@ -26,6 +26,7 @@ import itertools > import shutil > import collections > import tempfile > +from datetime import timedelta
Personally I prefer to keep the namespace, but it's just a suggestion
> from mako.template import Template
>
> # a local variable status exists, prevent accidental overloading by renaming
> @@ -383,9 +384,11 @@ class Summary:
> for each in self.results:
> os.mkdir(path.join(destination, each.name))
>
> + time = str(timedelta(0, each.time_elapsed)) if each.time_elapsed
> is not None else None
> +
Our python style is to keep the lines <= 79 characters when possible.
I'd do this:
if value.get('time'):
value['time'] = str(timedelta(0, value['time'])
> with open(path.join(destination, each.name, "index.html"), 'w')
> as out:
> out.write(testindex.render(nameêch.name,
> - timeêch.time_elapsed,
> + time=time,
> optionsêch.options,
> unameêch.uname,
> glxinfoêch.glxinfo,
> @@ -405,6 +408,8 @@ class Summary:
> if isinstance(value.get('dmesg'), list):
> value['dmesg'] = "\n".join(value['dmesg'])
>
> + value['time'] = str(timedelta(0, value.get('time'))) if
> value.get('time') is not None else None
> +
same comment as above
> with open(path.join(destination, each.name, key +
> ".html"),
> 'w') as out:
> out.write(testfile.render(
>
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ Piglit mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/piglit
