Nope, categories in GUI are GtkWidgets. TUI uses class attribute (string) so the logic is
a bit different. And I only updated this to support multiple paths, the code is already in
anaconda.
----- Original Message -----
> diff --git a/pyanaconda/ui/tui/spokes/__init__.py
> b/pyanaconda/ui/tui/spokes/__init__.py
> index a51a19e..1abe008 100644
> --- a/pyanaconda/ui/tui/spokes/__init__.py
> +++ b/pyanaconda/ui/tui/spokes/__init__.py
> @@ -81,13 +81,21 @@ class NormalTUISpoke(TUISpoke, NormalSpoke):
> class PersonalizationTUISpoke(TUISpoke, PersonalizationSpoke):
> pass
>
> -def collect_spokes(category):
> +def collect_spokes(mask_paths, category):
> """Return a list of all spoke subclasses that should appear
> for a given
> category.
> """
> - return collect("pyanaconda.ui.tui.spokes.%s",
> os.path.dirname(__file__), lambda obj: hasattr(obj, "category")
> and obj.category != None and obj.category == category)
> -
> -def collect_categories():
> - classes = collect("pyanaconda.ui.tui.spokes.%s",
> os.path.dirname(__file__), lambda obj: hasattr(obj, "category")
> and obj.category != None and obj.category != "")
> + spokes = []
> + for mask, path in mask_paths:
> + spokes.extend(collect(mask, path, lambda obj: hasattr(obj,
> "category") and obj.category != None and obj.category ==
> category))
> +
> + return spokes
> +
> +def collect_categories(mask_paths):
> + classes = []
> + for mask, path in mask_paths:
> + classes.extend(collect(mask, path, lambda obj:
> hasattr(obj, "category") and obj.category != None and obj.category
> != ""))
> +
> categories = set([c.category for c in classes])
> return categories
> +
Couldn't this be combined with similar code we've got for the GUI?
- Chris
_______________________________________________
anaconda-patches mailing list
anaconda-patches(a)lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches