[PATCH 2/2] Make Hub.storage and Spoke.storage a property

David Shea dshea at redhat.com
Tue Dec 10 16:21:47 UTC 2013


This fixes the usage of storage in abstract base classes.
---
 pyanaconda/ui/common.py | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/pyanaconda/ui/common.py b/pyanaconda/ui/common.py
index 627ae75..a6ce2a1 100644
--- a/pyanaconda/ui/common.py
+++ b/pyanaconda/ui/common.py
@@ -221,13 +221,17 @@ class Spoke(UIObject):
             raise TypeError("Spoke is an abstract class")
 
         UIObject.__init__(self, data)
-        self.storage = storage
+        self._storage = storage
         self.payload = payload
         self.instclass = instclass
         self.applyOnSkip = False
 
         self._visitedSinceApplied = True
 
+    @property
+    def storage(self):
+        return self._storage
+
     @classmethod
     def should_run(cls, environment, data):
         """This method is responsible for beginning Spoke initialization.
@@ -477,7 +481,7 @@ class Hub(UIObject):
         """
         UIObject.__init__(self, data)
 
-        self.storage = storage
+        self._storage = storage
         self.payload = payload
         self.instclass = instclass
 
@@ -487,6 +491,10 @@ class Hub(UIObject):
         # spokes for which environments this hub should collect?
         self._environs = [ANACONDA_ENVIRON]
 
+    @property
+    def storage(self):
+        return self._storage
+
     def set_path(self, path_id, paths):
         """Update the paths attribute with list of tuples in the form (module
            name format string, directory name)"""
-- 
1.8.4.2



More information about the anaconda-patches mailing list