[PATCH 09/13] Add and use MountpointSelector's attributes and properties
Vratislav Podzimek
vpodzime at redhat.com
Thu Mar 13 19:54:53 UTC 2014
On Thu, 2014-03-13 at 11:23 -0700, Brian C. Lane wrote:
> On Mon, Mar 10, 2014 at 02:22:15PM +0100, Vratislav Podzimek wrote:
> > This is the proper way how to do it.
> >
> > Signed-off-by: Vratislav Podzimek <vpodzime at redhat.com>
> > ---
> > pyanaconda/ui/gui/spokes/custom.py | 70 +++++++++++++++++++-------------------
> > widgets/python/AnacondaWidgets.py | 20 +++++++++++
> > 2 files changed, 55 insertions(+), 35 deletions(-)
>
> > + # our extension not related to the look of the widget
> > + self._device = None
> > + self._root = None
> > +
> > + @property
> > + def device(self):
> > + return self._device
> > +
> > + @device.setter
> > + def device(self, new_device):
> > + self._device = new_device
> > +
> > + @property
> > + def root(self):
> > + return self._root
> > +
> > + @root.setter
> > + def root(self, new_root):
> > + self._root = new_root
> > +
>
> I don't see the point in going to this trouble. If the properties aren't
> adding any checking/caching/etc. just use them directly.
I have no problem with using them directly if their names don't start
with the underscore. Fixing locally by renaming to self.root and
self.device and removing the extra code.
--
Vratislav Podzimek
Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic
More information about the anaconda-patches
mailing list