From a55c0be8a5a01eedcc5bdaac0259b03a1bea980d Mon Sep 17 00:00:00 2001 From: Charles Merriam Date: Sun, 1 Feb 2015 22:42:25 -0800 Subject: [PATCH] tesslate.py: Move print statements to logging Also dropped logging the number of vertices as it is displayed on the screen --- examples/canvas/tesselate.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/examples/canvas/tesselate.py b/examples/canvas/tesselate.py index bf2c8abc2..a75f15994 100644 --- a/examples/canvas/tesselate.py +++ b/examples/canvas/tesselate.py @@ -16,6 +16,7 @@ from kivy.graphics.tesselator import Tesselator, WINDING_ODD, TYPE_POLYGONS from kivy.uix.widget import Widget from kivy.uix.floatlayout import FloatLayout from kivy.lang import Builder +from kivy.logger import Logger Builder.load_string(""" : @@ -64,7 +65,7 @@ class ShapeBuilder(FloatLayout): def on_touch_down(self, touch): if super(ShapeBuilder, self).on_touch_down(touch): return True - print(touch.pos) + Logger.info('tesselate: on_touch_down (%5.2f, %5.2f)' % touch.pos) self.shape.extend(touch.pos) self.build() return True @@ -72,7 +73,7 @@ class ShapeBuilder(FloatLayout): def on_touch_move(self, touch): if super(ShapeBuilder, self).on_touch_move(touch): return True - print(touch.pos) + Logger.info('tesselate: on_touch_move (%5.2f, %5.2f)' % touch.pos) self.shape.extend(touch.pos) self.build() return True @@ -99,12 +100,8 @@ class ShapeBuilder(FloatLayout): count += 1 if not count: return - print("Tesselate {} shapes".format(count)) ret = tess.tesselate(WINDING_ODD, TYPE_POLYGONS) - print("Result: {}".format(ret)) - print("Vertex count: {}".format(tess.vertex_count)) - print("Element count: {}".format(tess.element_count)) - + Logger.info('tesselate: build: tess.teselate returns {}'.format(ret)) self.canvas.after.clear() debug = self.ids.debug.state == "down"