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 > Kubuntu User

 
 
LinkBack Thread Tools
 
Old 04-18-2012, 06:25 PM
David Lehman
 
Default Don't crash when there are no rnotes.

---
pyanaconda/ui/gui/hubs/progress.py | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/pyanaconda/ui/gui/hubs/progress.py b/pyanaconda/ui/gui/hubs/progress.py
index 85eca33..f2ae97b 100644
--- a/pyanaconda/ui/gui/hubs/progress.py
+++ b/pyanaconda/ui/gui/hubs/progress.py
@@ -108,8 +108,13 @@ class ProgressHub(Hub):
# Change the ransom notes image every minute by grabbing the next
# image's filename. Note that self._rnotes is an infinite list, so
# this will cycle through the images indefinitely.
- nxt = self._rnotes.next()
- self._rnotesImage.set_from_file(nxt)
+ try:
+ nxt = self._rnotes.next()
+ except StopIteration:
+ # there are no rnotes
+ pass
+ else:
+ self._rnotesImage.set_from_file(nxt)
return True

def initialize(self):
--
1.7.7.6

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 04-18-2012, 07:04 PM
Chris Lumens
 
Default Don't crash when there are no rnotes.

> diff --git a/pyanaconda/ui/gui/hubs/progress.py b/pyanaconda/ui/gui/hubs/progress.py
> index 85eca33..f2ae97b 100644
> --- a/pyanaconda/ui/gui/hubs/progress.py
> +++ b/pyanaconda/ui/gui/hubs/progress.py
> @@ -108,8 +108,13 @@ class ProgressHub(Hub):
> # Change the ransom notes image every minute by grabbing the next
> # image's filename. Note that self._rnotes is an infinite list, so
> # this will cycle through the images indefinitely.
> - nxt = self._rnotes.next()
> - self._rnotesImage.set_from_file(nxt)
> + try:
> + nxt = self._rnotes.next()
> + except StopIteration:
> + # there are no rnotes
> + pass

If you return False here, then we won't try to cycle rnotes any more.
Though, then there'll have to be some sort of guard around the
source_remove call in _update_progress. Seems a toss up as to which way
it should work.

- Chris

_______________________________________________
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 04:59 PM.

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