summaryrefslogtreecommitdiffstats
path: root/pyanaconda/install.py
diff options
context:
space:
mode:
authorChris Lumens <clumens@redhat.com>2012-04-16 16:47:14 -0400
committerChris Lumens <clumens@redhat.com>2012-04-16 16:55:22 -0400
commit336ed7dccfcc65fbeabdec038228dc791095831d (patch)
tree43e29157ee73e603134f1b6b3d0d86621139fe55 /pyanaconda/install.py
parenteb8d1f07c7e617bf452c1ee343b737d62b7d41c2 (diff)
downloadanaconda-336ed7dccfcc65fbeabdec038228dc791095831d.tar.gz
anaconda-336ed7dccfcc65fbeabdec038228dc791095831d.tar.xz
anaconda-336ed7dccfcc65fbeabdec038228dc791095831d.zip
Redo the progress bar code so it actually works.
With the previous code, I could never get the UI to be redrawn to reflect the changes, even though the changes appeared to have taken effect. This new code instead uses a message queue for communication between the thread doing all the hard work and the main thread that handles GTK stuff. The storage code will shove messages into that queue when it does something like create a filesystem, and the main thread watches in the idle loop for messages. I've also provided yet another context manager to make all this code simpler.
Diffstat (limited to 'pyanaconda/install.py')
-rw-r--r--pyanaconda/install.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/pyanaconda/install.py b/pyanaconda/install.py
index be78a56cb..4b1f4d221 100644
--- a/pyanaconda/install.py
+++ b/pyanaconda/install.py
@@ -29,7 +29,7 @@ def doInstall(storage, payload, ksdata, instClass):
The two main tasks for this are putting filesystems onto disks and
installing packages onto those filesystems.
"""
- from pyanaconda.progress import progress
+ from pyanaconda import progress
# First, run all the execute methods of the ksdata.
ksdata.bootloader.execute(storage, ksdata, instClass)
@@ -40,7 +40,7 @@ def doInstall(storage, payload, ksdata, instClass):
steps = len(storage.devicetree.findActions(type="create", object="format")) + \
len(storage.devicetree.findActions(type="resize", object="format")) + \
len(storage.devicetree.findActions(type="migrate", object="format"))
- progress.setSteps(steps)
+ progress.progressQ.put((progress.PROGRESS_CODE_INIT, [steps]))
# Do partitioning.
turnOnFilesystems(storage, errorHandler)
@@ -49,3 +49,5 @@ def doInstall(storage, payload, ksdata, instClass):
payload.preInstall()
payload.install()
payload.postInstall()
+
+ progress.progressQ.put((progress.PROGRESS_CODE_COMPLETE, []))