Tue, May 16, 2017 at 09:49:40AM CEST, olichtne(a)redhat.com wrote:
On Mon, May 15, 2017 at 05:40:34PM +0200, Jiri Pirko wrote:
> Thu, May 11, 2017 at 02:41:14PM CEST, olichtne(a)redhat.com wrote:
> >From: Ondrej Lichtner <olichtne(a)redhat.com>
> >
> >Module implementing the BaseRecipe class. Every LNST Recipe written by
> >testers should be inherited from this class. An LNST Recipe is composed
> >of several parts:
> >* Requirements definition
> >* Parameter definition (optional)
> >* Test definition
> >
> >Further documentation can be read in the classes doc string.
> >
> >Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
>
>
> [...]
>
>
> >+ def __init__(self, **kwargs):
> >+ """
> >+ The __init__ method does 2 things:
> >+ * copies Requirements -- since Requirements are defined as class
> >+ attributes, we need to copy the objects to avoid conflicts with
> >+ multiple instances of the same class etc...
> >+ The copied objects are stored under a Requirements object available
> >+ through the 'req' attribute. This way you can optionally
change the
> >+ Requirements of an instantiated Recipe.
> >+ * copies and instantiates Parameters -- Parameters are also class
> >+ attributes so they need to be copied into a Parameters() object
> >+ (accessible in the 'params' attribute).
> >+ Next, the copied objects are loaded with values from kwargs
> >+ and checked if mandatory Parameters have values.
> >+ """
> >+ self.matched = None
> >+ self.req = _Requirements()
> >+ self.params = Parameters()
> >+ for x in dir(self):
>
> I bet you can figure out some more descriptive variable name :)
>
is 'attr' better? :)
yes