diff options
author | Thomas Jourdan <b.vehikel@googlemail.com> | 2009-08-24 06:27:21 (GMT) |
---|---|---|
committer | Thomas Jourdan <b.vehikel@googlemail.com> | 2009-08-24 06:27:21 (GMT) |
commit | 96ed4036391c8ee3cb995fe760708be2cffad11b (patch) | |
tree | 27f8ad2dfae341c5d5059c618fd7d94c38fdba07 /ka_controller.py | |
parent | dfbf6edcf46d575f6a9b1f2f07992d1e5275d7d7 (diff) |
added random walk spline
Diffstat (limited to 'ka_controller.py')
-rw-r--r-- | ka_controller.py | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/ka_controller.py b/ka_controller.py index 05ef161..1163e80 100644 --- a/ka_controller.py +++ b/ka_controller.py @@ -15,7 +15,6 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -import hashlib import gtk import gtk.glade import cairo @@ -264,23 +263,20 @@ class KandidController(object): """Update population or protozoon preview when received from others.""" ka_debug.info('on_received: Received %u bytes, type: [%s] md5: [%s]' % \ (len(code_element), code_type, code_md5)) - if hashlib.md5(code_element).hexdigest() == code_md5: - inbox_widget = self._canvas.widgetTree.get_widget('incomingBox') - if code_type == kandidtube.SEND_POPULATION: - if self.is_overwrite_allowed: - self._update_model(model_population.from_buffer(code_element)) - self.model._state = model_population.STATE_EVOLVED - inbox_widget.queue_draw() - else: - ka_debug.info("I've already an evolved population, doing nothing") - elif code_type == kandidtube.SEND_PROTOZOON: - self.incoming.append_protozoon(model_population.from_buffer(code_element)) + inbox_widget = self._canvas.widgetTree.get_widget('incomingBox') + if code_type == kandidtube.SEND_POPULATION: + if self.is_overwrite_allowed: + self._update_model(model_population.from_buffer(code_element)) + self.model._state = model_population.STATE_EVOLVED inbox_widget.queue_draw() else: - ka_debug.info('Somebody called me using an illegal type [%s]' \ - % code_type) + ka_debug.info("I've already an evolved population, doing nothing") + elif code_type == kandidtube.SEND_PROTOZOON: + self.incoming.append_protozoon(model_population.from_buffer(code_element)) + inbox_widget.queue_draw() else: - ka_debug.info('Somebody called me with an corrupt data model') + ka_debug.err('Somebody called me using an illegal type [%s]' + % code_type) def on_new_tube(self, tube, is_initiator, get_buddy): """Creates communication object and sends population |