[PATCH 2/3 v2] Define the _device, _label and _options attributes in constructor
Anne Mulhern
amulhern at redhat.com
Fri Jan 23 18:54:27 UTC 2015
These look fine to me.
- mulhern
----- Original Message -----
> From: "Vratislav Podzimek" <vpodzime at redhat.com>
> To: anaconda-patches at lists.fedorahosted.org
> Sent: Friday, January 23, 2015 3:34:22 AM
> Subject: [PATCH 2/3 v2] Define the _device, _label and _options attributes in constructor
>
> That's how good guys do it.
>
> Signed-off-by: Vratislav Podzimek <vpodzime at redhat.com>
> ---
> blivet/formats/__init__.py | 10 +++++++---
> 1 file changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/blivet/formats/__init__.py b/blivet/formats/__init__.py
> index 907eb20..5e97620 100644
> --- a/blivet/formats/__init__.py
> +++ b/blivet/formats/__init__.py
> @@ -179,6 +179,10 @@ class DeviceFormat(ObjectID):
> it via the 'device' kwarg to the :meth:`create` method.
> """
> ObjectID.__init__(self)
> + self._label = None
> + self._options = None
> + self._device = None
> +
> self.device = kwargs.get("device")
> self.uuid = kwargs.get("uuid")
> self.exists = kwargs.get("exists", False)
> @@ -271,7 +275,7 @@ class DeviceFormat(ObjectID):
>
> This method is not intended to be overridden.
> """
> - self._label = label # pylint: disable=attribute-defined-outside-init
> + self._label = label
>
> def _getLabel(self):
> """The label for this filesystem.
> @@ -284,7 +288,7 @@ class DeviceFormat(ObjectID):
> return self._label
>
> def _setOptions(self, options):
> - self._options = options # pylint:
> disable=attribute-defined-outside-init
> + self._options = options
>
> def _getOptions(self):
> return self._options
> @@ -294,7 +298,7 @@ class DeviceFormat(ObjectID):
> def _setDevice(self, devspec):
> if devspec and not devspec.startswith("/"):
> raise ValueError("device must be a fully qualified path")
> - self._device = devspec # pylint:
> disable=attribute-defined-outside-init
> + self._device = devspec
>
> def _getDevice(self):
> return self._device
> --
> 2.1.0
>
> _______________________________________________
> anaconda-patches mailing list
> anaconda-patches at lists.fedorahosted.org
> https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches
>
More information about the anaconda-patches
mailing list