[PATCH 02/13] Make collect and part of UserInterface setup more generic

Chris Lumens clumens at redhat.com
Thu Aug 9 17:08:49 UTC 2012


>  pyanaconda/ui/__init__.py     |   38 ++++++++++++++++++++++++++++++++++++++
>  pyanaconda/ui/gui/__init__.py |   11 ++++++-----
>  2 files changed, 44 insertions(+), 5 deletions(-)

This was kind of annoyingly picky code to write in the first place.
Have you been able to test that the graphical interface still works as
it should given these changes?

> +    def getActionClasses(module_pattern, path, hubs, standalone_class):

I think you're missing a self argument here.

Also, could you add a docstring?  I should have done that in the first
place, but you're the latest person to touch it.

> +def collect(module_pattern, path, pred):
> +    """Traverse the directory (given by path) and find all classes that match
> +       the given predicate.  This is then returned as a list of classes.
> +
> +       It is suggested you use collect_categories or collect_spokes instead of
> +       this lower-level method.
> +    """

Please update the comment to mention the module_pattern argument.

> @@ -396,7 +397,7 @@ class QuitDialog(UIObject):
>          rc = self.window.run()
>          return rc
>  
> -def collect(subpath, pred):
> +def collect(module_pattern, path, pred):
>      """Traverse the subdirectory (given by subpath) of this module's current
>         directory and find all classes that math the given category.  This is
>         then returned as a list of classes.  If category is None, this method

The comment mentions subpath, but the function itself takes path.  Also,
please mention module_pattern somewhere in the comment.

- Chris


More information about the anaconda-patches mailing list