[PATCH 1/2] Move environmentAddons into packaging
Brian C. Lane
bcl at redhat.com
Mon Feb 17 17:04:44 UTC 2014
On Mon, Feb 17, 2014 at 07:48:31AM +0100, Vratislav Podzimek wrote:
> On Fri, 2014-02-14 at 16:30 -0800, Brian C. Lane wrote:
> > The environment addon refresh really only needs to be executed when new
> > metadata has been fetched so move it into packaging and call it after
> > metadata download. It was also running very slow from the other thread,
> > moving it speeds it up considerably.
> >
> > This also removes the need to call it from software.py when the source
> > has changed, since it will already be updated when the spoke is entered.
> > ---
> > pyanaconda/packaging/__init__.py | 33 ++++++++++++++++++++++++++++-
> > pyanaconda/packaging/dnfpayload.py | 1 +
> > pyanaconda/packaging/yumpayload.py | 3 +++
> > pyanaconda/ui/gui/spokes/software.py | 41 +++++++++---------------------------
> > 4 files changed, 46 insertions(+), 32 deletions(-)
> >
> > diff --git a/pyanaconda/packaging/__init__.py b/pyanaconda/packaging/__init__.py
> > index bcf0ac5..b7a056a 100644
> > --- a/pyanaconda/packaging/__init__.py
> > +++ b/pyanaconda/packaging/__init__.py
> > @@ -644,6 +644,13 @@ class PackagePayload(Payload):
> > super(PackagePayload, self).__init__(data)
> > self.install_device = None
> >
> > + # Used to determine which add-ons to display for each environment.
> > + # The dictionary keys are environment IDs. The dictionary values are two-tuples
> > + # consisting of lists of add-on group IDs. The first list is the add-ons specific
> > + # to the environment, and the second list is the other add-ons possible for the
> > + # environment.
> > + self._environmentAddons = {}
> I think that with moving the code to a better place we could also make
> it a better code and use namedtuple for values in this dictionary. I
> imagine it would make the code much better readable.
Possibly so, but I'd rather save larger changes like that for a later
patch.
--
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)
More information about the anaconda-patches
mailing list