[Piglit] [PATCH] framework/summary.py: Fix path resolution by using relative paths.

Dylan Baker baker.dylan.c at gmail.com
Tue Aug 20 23:37:57 PDT 2013


I have two concerns, first, it you've used tabs and space mixed. Please do not 
use tabs, please only use spaces for the python portions of piglit. There is a 
wonderful pep8 tool available from the python 'pip' tool, or from most linux 
distros package managers, that can be very helpful in catching pep8 issues.

second, testindex (the first part of your patch) doesn't take an index argument 
(the fact that it doesn't bail out is amazing, mako is usually very finiky 
about that) and it doesn't need one. This file is always 1 level deep, the mako 
template is hardcoded to use ../index.html there, becasue that is always 
right.

Finally, yes, there is a bug there in the way test pages link to home, 
however, just using index = path.relpath(index, tPath) will get the desired 
result.

I've pushed a fix upstream.

On Tuesday 20 August 2013 22:25:34 Kenney Phillis wrote:
> Fixes problems with path resolution when files change location.
> 
> NOTE: This patch is probably not be PEP8 Compliant.
> ---
>  framework/summary.py |    7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/framework/summary.py b/framework/summary.py
> index 35500bf..3929fd1 100644
> --- a/framework/summary.py
> +++ b/framework/summary.py
> @@ -522,7 +522,10 @@ class Summary:
>                                          time=each.time_elapsed,
>                                          options=each.options,
>                                          glxinfo=each.glxinfo,
> -                                        lspci=each.lspci))
> +                                        lspci=each.lspci,
> +				                        index=
> +											path.relpath(index,
> +											path.join(destination, 
each.name))))
>              file.close()
> 
>              # Then build the individual test results
> @@ -548,7 +551,7 @@ class Summary:
>                          traceback=value.get('traceback', 'None'),
>                          command=value.get('command', 'None'),
>                          css=path.relpath(resultCss, tPath),
> -                        index=index))
> +                        index=path.relpath(index,
> path.join(destination,each.name)))) file.close()
> 
>          # Finally build the root html files: index, regressions, etc


More information about the Piglit mailing list