[master 04/15] Cleanup how an installer interface can declare steps it does not implement.

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

 



---
 pyanaconda/cmdline.py              |    3 ---
 pyanaconda/gui.py                  |    3 ---
 pyanaconda/installclass.py         |    2 +-
 pyanaconda/installinterfacebase.py |    7 ++++---
 pyanaconda/text.py                 |    7 ++-----
 5 files changed, 7 insertions(+), 15 deletions(-)

diff --git a/pyanaconda/cmdline.py b/pyanaconda/cmdline.py
index 4a89e61..078dfb2 100644
--- a/pyanaconda/cmdline.py
+++ b/pyanaconda/cmdline.py
@@ -179,9 +179,6 @@ class InstallInterface(InstallInterfaceBase):
     def setInstallProgressClass(self, c):
         self.instProgress = c
 
-    def setSteps(self, anaconda):
-        pass
-
 class progressDisplay:
     def __init__(self):
         self.pct = 0
diff --git a/pyanaconda/gui.py b/pyanaconda/gui.py
index 64ef18b..f9b428f 100755
--- a/pyanaconda/gui.py
+++ b/pyanaconda/gui.py
@@ -1168,9 +1168,6 @@ class InstallInterface(InstallInterfaceBase):
         self.icw = InstallControlWindow(self.anaconda)
         self.icw.run()
 
-    def setSteps(self, anaconda):
-        pass
-
 class InstallControlWindow:
     def setLanguage (self):
         if not self.__dict__.has_key('window'): return
diff --git a/pyanaconda/installclass.py b/pyanaconda/installclass.py
index 7815051..fcd3f14 100644
--- a/pyanaconda/installclass.py
+++ b/pyanaconda/installclass.py
@@ -149,7 +149,7 @@ class BaseInstallClass(object):
             dispatch.skipStep("findrootparts", skip = 0)
 
         # allow interface backends to skip certain steps.
-        anaconda.intf.setSteps(anaconda)
+        map(lambda s: dispatch.skipStep(s), anaconda.intf.unsupported_steps())
 
     # modifies the uri from installmethod.getMethodUri() to take into
     # account any installclass specific things including multiple base
diff --git a/pyanaconda/installinterfacebase.py b/pyanaconda/installinterfacebase.py
index 7a65017..af15a91 100644
--- a/pyanaconda/installinterfacebase.py
+++ b/pyanaconda/installinterfacebase.py
@@ -33,9 +33,6 @@ class InstallInterfaceBase(object):
         self._initLabelAnswers = {}
         self._inconsistentLVMAnswers = {}
 
-    def setSteps(self, anaconda):
-        pass
-
     def messageWindow(self, title, text, type="ok", default = None,
              custom_buttons=None,  custom_icon=None):
         raise NotImplementedError
@@ -196,3 +193,7 @@ class InstallInterfaceBase(object):
                                              custom_icon=icon,
                                              custom_buttons=buttons,
                                              expanded=True)
+
+    def unsupported_steps(self):
+        """ List of steps this interface is unable to carry out. """
+        return []
diff --git a/pyanaconda/text.py b/pyanaconda/text.py
index a47631d..cde81a4 100644
--- a/pyanaconda/text.py
+++ b/pyanaconda/text.py
@@ -552,11 +552,8 @@ class InstallInterface(InstallInterfaceBase):
                     # a better answer
                     continue
 
-    def setSteps(self, anaconda):
-        anaconda.dispatch.skipStep("filtertype", permanent=1)
-        anaconda.dispatch.skipStep("filter", permanent=1)
-        anaconda.dispatch.skipStep("cleardiskssel", permanent=1)
-        anaconda.dispatch.skipStep("group-selection", permanent=1)
+    def unsupported_steps(self):
+        return ["filtertype", "filter", "cleardiskssel", "group-selection"]
 
 def killSelf(screen):
     screen.finish()
-- 
1.7.3.3

_______________________________________________
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