Tighten up interaction between source and software spokes.
The software spoke should only be ready when a valid source is
configured. Downloading of repo metadata happens in the background, as
does dependency checking.
---
pyanaconda/ui/gui/spokes/software.py | 33 ++++++++++++++++++++++++-
pyanaconda/ui/gui/spokes/source.py | 43 +++++++++++++++++++++++++++++----
2 files changed, 68 insertions(+), 8 deletions(-)
self.selectedGroups = []
self.excludedGroups = []
@@ -52,6 +53,8 @@ class SoftwareSelectionSpoke(NormalSpoke):
# NOTE: Other apply methods work directly with the ksdata, but this
# one does not. However, selectGroup/deselectGroup modifies ksdata as
# part of its operation. So this is fine.
+ from pyanaconda.threads import threadMgr, AnacondaThread
+
row = self._get_selected_desktop()
if not row:
return
@@ -69,9 +72,30 @@ class SoftwareSelectionSpoke(NormalSpoke):
for group in [g for g in groups if g not in self.excludedGroups]:
self.payload.selectGroup(group)
+ communication.send_not_ready(self.__class__.__name __)
+ threadMgr.add(AnacondaThread(name="AnaCheckSoftwar eThread",
+ target=self.checkSoftwareSelection))
+
+ def checkSoftwareSelection(self):
+ from pyanaconda.packaging import DependencyError
+ communication.send_message(self.__class__.__name__ ,
+ _("Checking software dependencies..."))
+ try:
+ self.payload.checkSoftwareSelection()
+ except DependencyError as e:
+ self._error = True
+ communication.send_message(self.__class__.__name__ ,
+ _("Error checking software dependencies"))
+ else:
+ communication.send_ready(self.__class__.__name__)
+ self._error = False
+
@property
def completed(self):
- return self._get_selected_desktop() is not None
+ from pyanaconda.threads import threadMgr
+ return self._get_selected_desktop() is not None and
+ not threadMgr.get("AnaCheckSoftwareThread") and
+ not self._error
@property
def ready(self):
@@ -80,10 +104,15 @@ class SoftwareSelectionSpoke(NormalSpoke):
# becasue the user filled something out, or because we're done fetching
# repo metadata from the mirror list, or we detected a DVD/CD.
from pyanaconda.threads import threadMgr
- return self._ready and not threadMgr.get("AnaPayloadMDThread")
+ return (self._ready and not threadMgr.get("AnaPayloadMDThread") and
+ not threadMgr.get("AnaCheckSoftwareThread") and
+ self.payload.baseRepo is not None)
@property
def status(self):
+ if self._error:
+ return _("Error checking software selection")
+
row = self._get_selected_desktop()
if not row:
return _("Nothing selected")
diff --git a/pyanaconda/ui/gui/spokes/source.py b/pyanaconda/ui/gui/spokes/source.py
index 8d59abe..2dd9cc1 100644
--- a/pyanaconda/ui/gui/spokes/source.py
+++ b/pyanaconda/ui/gui/spokes/source.py
@@ -37,6 +37,9 @@ __all__ = ["SourceSpoke"]
@property
def completed(self):
- return self.status and self.status != _("Nothing selected")
+ return not self._error and self.status and self.status != _("Nothing selected")
@property
def ready(self):
+ from pyanaconda.threads import threadMgr
# By default, the source spoke is not ready. We have to wait until
# storageInitialize is done to know whether or not there's local
# devices potentially holding install media.
- return self._ready
+ return (self._ready and not threadMgr.get("AnaPayloadMDThread"))
@property
def status(self):
@@ -328,6 +357,8 @@ class SourceSpoke(NormalSpoke):
else:
if self.payload.baseRepo:
return _("Closest mirror")
+ elif self._error:
+ return _("Error setting up software source")
else:
return _("Nothing selected")
@@ -374,7 +405,7 @@ class SourceSpoke(NormalSpoke):
if storageThread:
storageThread.join()