Add a ready method and an overridden populate method to NormalSpoke.
These methods are required for more strange background processing, mainly
required for storage.
---
pyanaconda/ui/gui/spokes/__init__.py | 17 +++++++++++++++++
pyanaconda/ui/gui/spokes/keyboard.py | 4 ++--
pyanaconda/ui/gui/spokes/software.py | 4 ++--
pyanaconda/ui/gui/spokes/source.py | 4 ++--
4 files changed, 23 insertions(+), 6 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/__init__.py b/pyanaconda/ui/gui/spokes/__init__.py
index 6124c87..216fc12 100644
--- a/pyanaconda/ui/gui/spokes/__init__.py
+++ b/pyanaconda/ui/gui/spokes/__init__.py
@@ -169,6 +169,23 @@ class NormalSpoke(Spoke):
Spoke.__init__(self, data, devicetree, instclass)
+ def populate(self, readyCB=None):
+ """A special overridden version of UIObject.populate. This method
+ also takes a callback to be called whenever this spoke becomes
+ ready (see below). Very few spokes should ever concern themselves
+ with this, however.
+ """
+ Spoke.populate(self)
+
+ @property
+ def ready(self):
+ """Returns True if the Spoke has all the information required to be
+ displayed. Almost all spokes should keep the default value here.
+ Only override this method if the Spoke requires some potentially
+ long-lived process (like storage probing) before it's ready.
+ """
+ return True
+
class PersonalizationSpoke(Spoke):
"""A PersonalizationSpoke is a Spoke subclass that is displayed when the
user selects something on the Hub during package installation.
diff --git a/pyanaconda/ui/gui/spokes/keyboard.py b/pyanaconda/ui/gui/spokes/keyboard.py
index a88ca62..83ce651 100644
--- a/pyanaconda/ui/gui/spokes/keyboard.py
+++ b/pyanaconda/ui/gui/spokes/keyboard.py
@@ -120,8 +120,8 @@ class KeyboardSpoke(NormalSpoke):
def status(self):
return _("Something selected")