From 89912e41761ee8a3fb7d50d9c01ee83d14cfaa97 Mon Sep 17 00:00:00 2001 From: Thomas Jourdan Date: Mon, 18 Jan 2010 19:59:18 +0000 Subject: clean up before release --- diff --git a/NEWS b/NEWS index c51b087..6d42c48 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,12 @@ An introduction to Kandid can be found at sugarlabs.org . http://wiki.sugarlabs.org/go/Activities/Kandid +v3: January 2010 +Some new views added to Kandid: + Starting anew will show the 'Getting started' view. + The zoom view shows a selected protozoon with higher resolution. + The status view is for monitoring the programs internal state. +Scalable vector graphics (SVG) and Unicode characters will be used as stamps. + v2: December 2009 first public release - diff --git a/ep_page_zoom.py b/ep_page_zoom.py index ceff3d4..14418cc 100644 --- a/ep_page_zoom.py +++ b/ep_page_zoom.py @@ -104,7 +104,6 @@ class ZoomController(object): ctx = cairo.Context(self._surface) protozoon.render(ctx, width, height) # ka_debug.info('task_render exit: ') -#!! ka_task.GeneratorTask.leave() def start_calculation(self, zoom_protozoon): """Start rendering of protozoon.""" diff --git a/ka_controller.py b/ka_controller.py index 66581b7..2dfe26d 100644 --- a/ka_controller.py +++ b/ka_controller.py @@ -140,18 +140,18 @@ class KandidController(object): pre: widget is not None """ # draw precalculated protozoon stored in the surface cache. - ka_debug.info('on_drawingarea_expose: ' + widget.name + ' ' - + str(widget.allocation.width) - + 'x' + str(widget.allocation.height)) +# ka_debug.info('on_drawingarea_expose: ' + widget.name + ' ' +# + str(widget.allocation.width) +# + 'x' + str(widget.allocation.height)) self._draw_from_cache(widget, name_to_index(widget.name)) def on_drawingarea_size_allocate(self, widget, event): """ New size for drawing area available. pre: widget is not None """ - ka_debug.info('on_drawingarea_size_allocate: ' + widget.name + ' ' - + str(widget.allocation.width) - + 'x' + str(widget.allocation.height)) +# ka_debug.info('on_drawingarea_size_allocate: ' + widget.name + ' ' +# + str(widget.allocation.width) +# + 'x' + str(widget.allocation.height)) self.start_calculation([name_to_index(widget.name)]) def on_fitness_value_changed(self, *args): @@ -186,12 +186,12 @@ class KandidController(object): """ pre: len(args) == 1 """ - ka_debug.info('on_model_completed entry') +# ka_debug.info('on_model_completed entry') for cell_index in args[0]: self._widget_tree.get_widget('vbox_' + str(cell_index)). \ set_sensitive(False) self.start_calculation(args[0]) - ka_debug.info('on_model_completed exit') +# ka_debug.info('on_model_completed exit') def on_timer(self, *args): if self._start_from_scratch: @@ -199,7 +199,7 @@ class KandidController(object): def start_all_calculations(self): self._start_from_scratch = False - ka_debug.info('start_all_calculations %u' % (self.model.size)) +# ka_debug.info('start_all_calculations %u' % (self.model.size)) ka_debug.print_call_stack() self.start_calculation([i for i in range(self.model.size)]) @@ -215,8 +215,8 @@ class KandidController(object): self.on_image_completed) task.start(self.model.protozoans[cell_index], cell_index, widget.allocation.width, widget.allocation.height) - ka_debug.info('start_calculation %ux%u for %s' % - (widget.allocation.width, widget.allocation.height, widget.name)) +# ka_debug.info('start_calculation %ux%u for %s' % +# (widget.allocation.width, widget.allocation.height, widget.name)) def task_breed_generation(self, *args, **kwargs): """ @@ -225,7 +225,6 @@ class KandidController(object): # ka_debug.info('task_breed_generation entry') new_indices = self.model.breed_generation() # ka_debug.info('task_breed_generation exit') -#!! ka_task.GeneratorTask.leave() return new_indices def task_breed_single(self, *args, **kwargs): @@ -235,7 +234,6 @@ class KandidController(object): # ka_debug.info('task_breed_single entry') new_indices = self.model.breed_single(args[0]) # ka_debug.info('task_breed_single exit') -#!! ka_task.GeneratorTask.leave() return new_indices def task_random_generation(self, *args, **kwargs): @@ -245,7 +243,6 @@ class KandidController(object): # ka_debug.info('task_random_generation entry') new_indices = self.model.random() # ka_debug.info('task_random_generation exit') -#!! ka_task.GeneratorTask.leave() return new_indices def task_render(self, *args, **kwargs): @@ -260,7 +257,6 @@ class KandidController(object): protozoon.render(ctx, width, height) self.surface_cache[cell_index] = surface # ka_debug.info('task_render exit: ' + str(cell_index)) -#!! ka_task.GeneratorTask.leave() return cell_index def on_image_completed(self, *args): @@ -396,7 +392,7 @@ class KandidController(object): popup_menu.popup(None, None, None, event.button, event.time) def on_zoom_incoming(self, menu_item): - ka_debug.info('on_zoom_incoming [%s]' % menu_item.parent.name) +# ka_debug.info('on_zoom_incoming [%s]' % menu_item.parent.name) if self.zoom_controller is not None: index = name_to_index(menu_item.parent.name) protozoon, dummy = self.incoming.at_index(index) diff --git a/ka_incoming.py b/ka_incoming.py index c73009e..a99d2a9 100644 --- a/ka_incoming.py +++ b/ka_incoming.py @@ -78,9 +78,9 @@ class KandidIncoming(object): task = ka_task.GeneratorTask(self.task_render, self.on_image_completed) task.start(incoming_protozoon, KandidIncoming.ids, widget.allocation.width, widget.allocation.height) - ka_debug.info('incoming: start_calculation %ux%u, iid %u for %s' % - (widget.allocation.width, widget.allocation.height, - KandidIncoming.ids, widget.name)) +# ka_debug.info('incoming: start_calculation %ux%u, iid %u for %s' % +# (widget.allocation.width, widget.allocation.height, +# KandidIncoming.ids, widget.name)) def accept_protozoon(self, index): """ Move protozoon from incoming list to image population. @@ -88,7 +88,7 @@ class KandidIncoming(object): """ protozoon, iid = self.at_index(index) if protozoon is not None: - ka_debug.info('incoming: accept incoming protozoon %u' % iid) +# ka_debug.info('incoming: accept incoming protozoon %u' % iid) del self.incoming_id[index] del self.incoming_protozoans[iid] if self.incoming_surface_cache.has_key(iid): @@ -101,7 +101,7 @@ class KandidIncoming(object): pre: 0 <= index < self._capacity """ if index < len(self.incoming_protozoans): - ka_debug.info('incoming: decline incoming protozoon %u' % index) +# ka_debug.info('incoming: decline incoming protozoon %u' % index) iid = self.incoming_id[index] del self.incoming_id[index] del self.incoming_protozoans[iid] @@ -115,26 +115,25 @@ class KandidIncoming(object): """ protozoon, iid, width, height = \ args[0], args[1], args[2], args[3] - ka_debug.info('incoming: task_render entry: ' + str(iid)) +# ka_debug.info('incoming: task_render entry: ' + str(iid)) surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, width, height) ctx = cairo.Context(surface) protozoon.render(ctx, width, height) if self.incoming_protozoans.has_key(iid): self.incoming_surface_cache[iid] = surface - ka_debug.info('incoming: task_render exit: ' + str(iid)) -#!! ka_task.GeneratorTask.leave() +# ka_debug.info('incoming: task_render exit: ' + str(iid)) return iid def on_image_completed(self, *args): """Rendering task has finished""" - ka_debug.info('incoming: on_image_completed: ' + str(args[0])) +# ka_debug.info('incoming: on_image_completed: ' + str(args[0])) self._update_incomming_gui() def on_incomingarea_expose(self, widget, dummy): """ Repaint image of a single protozoon inside incoming area. pre: widget is not None """ - ka_debug.info('incoming: on_incomingarea_expose: ' + widget.name) +# ka_debug.info('incoming: on_incomingarea_expose: ' + widget.name) self.draw(ka_controller.name_to_index(widget.name), \ ka_controller.create_context(widget), \ widget.allocation.width, widget.allocation.height) diff --git a/po/Kandid.pot b/po/Kandid.pot index e1865c5..dcc9281 100644 --- a/po/Kandid.pot +++ b/po/Kandid.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-01-17 16:53+0100\n" +"POT-Creation-Date: 2010-01-18 20:50+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/test_suite.py b/test_suite.py index df56801..c3db4ae 100644 --- a/test_suite.py +++ b/test_suite.py @@ -113,7 +113,6 @@ class TestKandidModel(unittest.TestCase): #self.assertEqual(1, _test_task_completed_count) def task_1(self, *args, **kwargs): -#!! ka_task.GeneratorTask.leave() print 'leave 1', _test_task_completed_count def task_2(self, *args, **kwargs): -- cgit v0.9.1