Re: [PATCH pykickstart] Add lineno to BaseData and derived classes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> diff --git a/pykickstart/base.py b/pykickstart/base.py
> index aa4e9d8..3c1237a 100644
> --- a/pykickstart/base.py
> +++ b/pykickstart/base.py
> @@ -157,7 +157,9 @@ class KickstartCommand(KickstartObject):
>      # useful to call this from KickstartCommand subclasses that handle lists
>      # of objects (like partitions, network devices, etc.) and need to populate
>      # a Data object.
> -    def _setToObj(self, optParser, opts, obj):
> +    def _setToObj(self, optParser, opts, obj, lineno=None):
> +        if lineno:
> +            obj.lineno = lineno
>          for key in filter (lambda k: getattr(opts, k) != None, optParser.keys()):
>              setattr(obj, key, getattr(opts, key))
>  

I'm not really sure I like _setToObj doing this.  If you look at the
comment above it, it's really just meant for copying things from
optParser to obj.  This overloading doesn't really seem to fit.

I don't have a better suggestion than setting lineno manually after
calling _setToObj in the rest of this patch.

> @@ -431,13 +433,14 @@ class BaseData(KickstartObject):
>      removedAttrs = []
>  
>      def __init__(self, *args, **kwargs):
> -        """Create a new BaseData instance.  There are no attributes."""
> +        """Create a new BaseData instance.  The only attribute is lineno."""

Even though it's entirely obvious, please make this comment look like
the rest of the docs strings in pykickstart.

- Chris

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux