pep8 fixes

This commit is contained in:
Mathieu Virbel 2012-03-18 23:52:59 +01:00
parent ae55b72020
commit 88103c5571
1 changed files with 7 additions and 9 deletions

View File

@ -559,9 +559,8 @@ class TextInput(Widget):
if not self._label_cached:
self._get_line_options()
text = text.replace('\t', ' ' * self.tab_width)
if(not self.password):
if not self.password:
return self._label_cached.get_extents(text)[0]
else:
return self._label_cached.get_extents('*' * len(text))[0]
def _do_blink_cursor(self, dt):
@ -796,7 +795,7 @@ class TextInput(Widget):
def _create_line_label(self, text):
# Create a label from a text, using line options
ntext = text.replace('\n', '').replace('\t', ' ' * self.tab_width)
if(self.password):
if self.password:
ntext = '*' * len(ntext)
kw = self._get_line_options()
cid = '%s\0%s' % (ntext, str(kw))
@ -983,11 +982,10 @@ class TextInput(Widget):
password = BooleanProperty(False)
'''If True, the widget will display its characters as the character*.
:data:`password` is a :class:`~kivy.properties.BooleanProperty`, default to
False
.. versionadded:: 1.1.2
:data:`password` is a :class:`~kivy.properties.BooleanProperty`, default to
False
'''
cursor_blink = BooleanProperty(False)