On Mon, May 11, 2015 at 06:00:41PM -0400, Ilia Mirkin wrote:
> On Mon, May 11, 2015 at 5:57 PM, Dylan Baker <[email protected]> wrote:

[snip]

> > +        def print_summary():
> > +            """print a summary."""
> > +            print("summary:\n"
> > +                  "       pass: {pass}\n"
> > +                  "       fail: {fail}\n"
> > +                  "      crash: {crash}\n"
> > +                  "       skip: {skip}\n"
> > +                  "    timeout: {timeout}\n"
> > +                  "       warn: {warn}\n"
> > +                  " incomplete: {incomplete}\n"
> > +                  " dmesg-warn: {dmesg-warn}\n"
> > +                  " dmesg-fail: {dmesg-fail}".format(**self.totals))
> > +            if self.tests['changes']:
> 
> I never know how these inner functions work... can you confirm that
> 'self' points to the right thing with this?

Functions defined inside functions are closures, with access to all of
the variables in the scope they are defined in.

I can confirm that piglit summary console -s <my result> does the right
thing.

[snip]

Attachment: signature.asc
Description: Digital signature

_______________________________________________
Piglit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/piglit

Reply via email to