This commit is contained in:
Qua-non 2012-08-31 17:12:16 +05:30
commit 41e994e263
3 changed files with 13 additions and 12 deletions

View File

@ -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 :

View File

@ -396,19 +396,18 @@ 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)
except UnicodeEncodeError:
return 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')

View File

@ -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)