Mercurial > libervia-web
changeset 212:a05e16f4a343
browser side: bug fix (missing "self." before value_max)
and "cosmetic" changes (PEP 8)
author | souliane <souliane@mailoo.org> |
---|---|
date | Fri, 06 Sep 2013 15:55:45 +0200 |
parents | 49920d76aa6a |
children | 8bbac49765d6 |
files | browser_side/dialog.py |
diffstat | 1 files changed, 8 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/browser_side/dialog.py Fri Sep 06 15:51:40 2013 +0200 +++ b/browser_side/dialog.py Fri Sep 06 15:55:45 2013 +0200 @@ -323,32 +323,32 @@ self.value = value self.box.setText(str(value)) self._callListeners() - + def onMinus(self, sender, step=1): - self.value=max(0,self.value-step) + self.value = max(0, self.value - step) self.box.setText(str(self.value)) self._callListeners() - + def onPlus(self, sender, step=1): - self.value+=step + self.value += step if self.value_max: - self.value = min(self.value,value_max) + self.value = min(self.value, self.value_max) self.box.setText(str(self.value)) self._callListeners() def onInput(self, sender): """Accept only valid integer && normalize print (no leading 0)""" try: - self.value = int(self.box.getText()) if self.box.getText() else 0 + self.value = int(self.box.getText()) if self.box.getText() else 0 except ValueError: pass if self.value_max: - self.value = min(self.value,value_max) + self.value = min(self.value, self.value_max) self.box.setText(str(self.value)) self._callListeners() def onMouseWheel(self, sender, velocity): - if velocity>0: + if velocity > 0: self.onMinus(sender, 10) else: self.onPlus(sender, 10)