From dc70c6d359968d4bc21c66cbc4656e08ad9b91ce Mon Sep 17 00:00:00 2001 From: "Edwin Marshall (aspidites)" Date: Tue, 28 Aug 2012 01:31:23 -0400 Subject: [PATCH 1/4] - fixes issue #649, simpler alternative to pull request # 651 --- kivy/core/text/__init__.py | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/kivy/core/text/__init__.py b/kivy/core/text/__init__.py index 25aa8834f..157c2e793 100644 --- a/kivy/core/text/__init__.py +++ b/kivy/core/text/__init__.py @@ -396,19 +396,16 @@ class LabelBase(object): sz[1] + self.options['padding_y'] * 2 def _get_text(self): - return self._text + try: + return self._text.decode('utf8') + except AttributeError: + # python 3 support + return str(self._text) def _set_text(self, text): - if text == self._text: - return - # try to automaticly decode unicode - try: - self._text = text.decode('utf8') - except: - try: - self._text = str(text) - except: - self._text = text + if text != self._text: + self._text = text + text = property(_get_text, _set_text, doc='Get/Set the text') label = property(_get_text, _set_text, doc='Get/Set the text') From 28c543f0e900fe3dc6ef38f59b64c14247d69cee Mon Sep 17 00:00:00 2001 From: "Edwin Marshall (aspidites)" Date: Tue, 28 Aug 2012 11:17:50 -0400 Subject: [PATCH 2/4] - return text if already unicode --- kivy/core/text/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kivy/core/text/__init__.py b/kivy/core/text/__init__.py index 157c2e793..bfadf80f5 100644 --- a/kivy/core/text/__init__.py +++ b/kivy/core/text/__init__.py @@ -401,6 +401,8 @@ class LabelBase(object): except AttributeError: # python 3 support return str(self._text) + except UnicodeEncodeError: + return self._text def _set_text(self, text): if text != self._text: From 57808f435718a1948da32e7d7c1f25d241c15186 Mon Sep 17 00:00:00 2001 From: Waldo Bronchart Date: Thu, 30 Aug 2012 23:50:12 +0200 Subject: [PATCH 3/4] Fixed bug with Camera widget in .kv file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The resolution property is not initialized before _on_index() is called. So the app crashes because [-1, -1] is not a supported resolution. ... Camera:     resolution: (640, 480)     index: 0 --- kivy/uix/camera.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kivy/uix/camera.py b/kivy/uix/camera.py index 81eb5dfb9..c707a9cf1 100644 --- a/kivy/uix/camera.py +++ b/kivy/uix/camera.py @@ -96,6 +96,8 @@ class Camera(Image): self._camera = None if self.index < 0: return + if self.resolution[0] < 0 or self.resolution[1] < 0: + return self._camera = CoreCamera(index=self.index, resolution=self.resolution, stopped=True) self._camera.bind(on_load=self._camera_loaded) From 55bc83f68a5bff79d149283151fc106e3dffbf0f Mon Sep 17 00:00:00 2001 From: "Edwin Marshall (aspidites)" Date: Thu, 30 Aug 2012 22:11:24 -0400 Subject: [PATCH 4/4] - instruct user to install nose from pip, not nosetest, fixes #655 --- doc/sources/installation/installation.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/sources/installation/installation.rst b/doc/sources/installation/installation.rst index 16520c864..ea975ebc4 100644 --- a/doc/sources/installation/installation.rst +++ b/doc/sources/installation/installation.rst @@ -129,7 +129,7 @@ one .) Kivy tests are based on nosetest, that you can install from your package manager or using pip : - $ pip install nosetest + $ pip install nose to run the test suite, do :