# HG changeset patch # User souliane # Date 1378475745 -7200 # Node ID a05e16f4a343daa82521110f968b4922fbff1a60 # Parent 49920d76aa6a24a88a9e08f7cdfbfdcbc7986f62 browser side: bug fix (missing "self." before value_max) and "cosmetic" changes (PEP 8) diff -r 49920d76aa6a -r a05e16f4a343 browser_side/dialog.py --- 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)