[PATCH 07/11] pylint does not like @foo.setter

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

 



pylint does not like @foo.setter, so use the
foo = property(setter, getter)
Notation instead. Note that we already use this notation everywhere except
for these 2 places, so doing things this way is more consistent anyways.
---
 storage/formats/dmraid.py    |    9 +++++----
 storage/formats/multipath.py |    9 +++++----
 2 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/storage/formats/dmraid.py b/storage/formats/dmraid.py
index 5a05b2b..f516720 100644
--- a/storage/formats/dmraid.py
+++ b/storage/formats/dmraid.py
@@ -76,14 +76,15 @@ class DMRaidMember(DeviceFormat):
         # Initialize the attribute that will hold the block object.
         self._raidmem = None
 
-    @property
-    def raidmem(self):
+    def _getRaidmem(self):
         return self._raidmem
 
-    @raidmem.setter
-    def raidmem(self, raidmem):
+    def _setRaidmem(self, raidmem):
         self._raidmem = raidmem
 
+    raidmem = property(lambda d: d._getRaidmem(),
+                       lambda d,r: d._setRaidmem(r))
+
     def create(self, *args, **kwargs):
         log_method_call(self, device=self.device,
                         type=self.type, status=self.status)
diff --git a/storage/formats/multipath.py b/storage/formats/multipath.py
index cad2552..fe2702e 100644
--- a/storage/formats/multipath.py
+++ b/storage/formats/multipath.py
@@ -66,14 +66,15 @@ class MultipathMember(DeviceFormat):
         # Initialize the attribute that will hold the block object.
         self._member = None
 
-    @property
-    def member(self):
+    def _getMember(self):
         return self._member
 
-    @member.setter
-    def member(self, member):
+    def _setMember(self, member):
         self._member = member
 
+    member = property(lambda s: s._getMember(),
+                      lambda s,m: s._setMember(m))
+
     def create(self, *args, **kwargs):
         log_method_call(self, device=self.device,
                         type=self.type, status=self.status)
-- 
1.6.4

_______________________________________________
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