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

Martin Sivak msivak at redhat.com
Fri Aug 10 09:12:16 UTC 2012


Yeah I was missing self and I improved the docs.
The code should still work as collect I used in text mode too and the getActionClasses is still the same code.
There is no way of testing the whole UI without a test compose though.. single Spokes and Hubs are OK.

Martin

----- Original Message -----
> >  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
> _______________________________________________
> anaconda-patches mailing list
> anaconda-patches at lists.fedorahosted.org
> https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches
> 


More information about the anaconda-patches mailing list