[PATCH 1/3] Fix how spokes are collected for the I-S main hub
Vratislav Podzimek
vpodzime at redhat.com
Mon Oct 7 15:16:45 UTC 2013
Related: rhbz#1000409
Signed-off-by: Vratislav Podzimek <vpodzime at redhat.com>
---
initial_setup/tui/hubs/initial_setup_hub.py | 43 +++--------------------------
1 file changed, 4 insertions(+), 39 deletions(-)
diff --git a/initial_setup/tui/hubs/initial_setup_hub.py b/initial_setup/tui/hubs/initial_setup_hub.py
index 804acaf..73f8269 100644
--- a/initial_setup/tui/hubs/initial_setup_hub.py
+++ b/initial_setup/tui/hubs/initial_setup_hub.py
@@ -1,3 +1,4 @@
+from pyanaconda.constants import FIRSTBOOT_ENVIRON
from pyanaconda.ui.tui.hubs import TUIHub
from pyanaconda.ui.tui.spokes import TUISpoke
from pyanaconda.ui.common import collect
@@ -11,25 +12,6 @@ __all__ = ["InitialSetupMainHub"]
_ = lambda x: gettext.ldgettext("initial-setup", x)
N_ = lambda x: x
-def collect_spokes(mask_paths):
- """Return a list of all spoke subclasses that should appear for a given
- category. Look for them in files imported as module_path % basename(f)
-
- :param mask_paths: list of mask, path tuples to search for classes
- :type mask_paths: list of (mask, path)
-
- :return: list of Spoke classes belonging to category
- :rtype: list of Spoke classes
-
- """
- spokes = []
- for mask, path in mask_paths:
- spokes.extend(collect(mask, path,
- lambda obj: issubclass(obj, Spoke) and obj.should_run("firstboot", None)))
-
- return spokes
-
-
class InitialSetupMainHub(TUIHub):
categories = ["password", "localization"]
@@ -39,23 +21,6 @@ class InitialSetupMainHub(TUIHub):
else:
title = _("Initial setup")
- def _collectCategoriesAndSpokes(self):
- """collects categories and spokes to be displayed on this Hub
-
- :return: dictionary mapping category class to list of spoke classes
- :rtype: dictionary[category class] -> [ list of spoke classes ]
- """
-
- ret = {}
-
- # Collect all the categories this hub displays, then collect all the
- # spokes belonging to all those categories.
- candidate_spokes = collect_spokes(self.paths["spokes"])
- spokes = [spoke for spoke in candidate_spokes \
- if spoke.should_run("firstboot", self.data)]
-
- for spoke in spokes:
- ret.setdefault(spoke.category, [])
- ret[spoke.category].append(spoke)
-
- return ret
+ def __init__(self, *args):
+ TUIHub.__init__(self, *args)
+ self._environs = [FIRSTBOOT_ENVIRON]
--
1.7.11.7
More information about the anaconda-patches
mailing list