FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu User

 
 
LinkBack Thread Tools
 
Old 01-25-2012, 07:11 PM
Chris Lumens
 
Default 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")

- def populate(self):
- NormalSpoke.populate(self)
+ def populate(self, readyCB=None):
+ NormalSpoke.populate(self, readyCB)

self._store = self.builder.get_object("addedLayoutStore")
self._addLayout(self._store, "English (US)")
diff --git a/pyanaconda/ui/gui/spokes/software.py b/pyanaconda/ui/gui/spokes/software.py
index 3cb71a4..7e80f2f 100644
--- a/pyanaconda/ui/gui/spokes/software.py
+++ b/pyanaconda/ui/gui/spokes/software.py
@@ -55,8 +55,8 @@ class SoftwareSelectionSpoke(NormalSpoke):

return row[2]

- def populate(self):
- NormalSpoke.populate(self)
+ def populate(self, readyCB=None):
+ NormalSpoke.populate(self, readyCB)

self._desktopStore = self.builder.get_object("desktopStore")
self._addSelection(self._desktopStore, "Desktop", "The default Fedora desktop.")
diff --git a/pyanaconda/ui/gui/spokes/source.py b/pyanaconda/ui/gui/spokes/source.py
index a5a8d8e..6033ff7 100644
--- a/pyanaconda/ui/gui/spokes/source.py
+++ b/pyanaconda/ui/gui/spokes/source.py
@@ -203,8 +203,8 @@ class SourceSpoke(NormalSpoke):

self._verifyIsoButton = self.builder.get_object("verifyIsoButton")

- def populate(self):
- NormalSpoke.populate(self)
+ def populate(self, readyCB=None):
+ NormalSpoke.populate(self, readyCB)

self._grabObjects()

--
1.7.6

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 07:34 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org