Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorflavio <fdanesse@gmail.com>2013-03-22 20:17:57 (GMT)
committer Aleksey Lim <alsroot@sugarlabs.org>2013-03-24 09:11:55 (GMT)
commit09454b3e4e85caf05c2dd3824608f1cd662f6ad5 (patch)
treefc5e29f02b14234bb6adaf1508f2474d019c75f1
parentd5dddee8995c0e1a2cac6e561b08c171b65f1f93 (diff)
If the user has not created a sequence of images, Take snapshot throws an error.
-rw-r--r--montage.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/montage.py b/montage.py
index 4664bb2..ee0facf 100644
--- a/montage.py
+++ b/montage.py
@@ -119,12 +119,13 @@ class View(gtk.EventBox):
def exportframe(self):
self.frames = kinematic.makeframes()
- fsecs = self.frames.keys()
- firstpixindex = fsecs[0]
+ if not self.frames:
+ return
+ firstpixindex = self.frames.keys()[0]
x, y, width, height = self.mfdraw.get_allocation()
pixmap = gtk.gdk.Pixmap(self.mfdraw.window, width, height)
- self._draw_frame(fsecs[0], pixmap)
+ self._draw_frame(firstpixindex, pixmap)
pixbuf = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB, False, 8, width, height)
gtk.gdk.Pixbuf.get_from_drawable(pixbuf, pixmap, pixmap.get_colormap(), 0, 0, 0, 0, width, height)