OSDN Git Service

Use a non-zero test when checking for non-emptiness of a string instead of calling...
authorJames Teh <jamie@jantrid.net>
Tue, 18 Sep 2012 05:00:10 +0000 (15:00 +1000)
committerJames Teh <jamie@jantrid.net>
Tue, 18 Sep 2012 05:00:10 +0000 (15:00 +1000)
source/brailleDisplayDrivers/papenmeier.py

index 98d2531..15b7aec 100644 (file)
@@ -419,7 +419,7 @@ connection could not be established"""
        def executeGesture(self,gesture):\r
                """executes a gesture"""\r
                if(gesture.id == 'r1'):  gesture.id = next(self._r1next)\r
-               if(len(gesture.id)): inputCore.manager.executeGesture(gesture)\r
+               if gesture.id: inputCore.manager.executeGesture(gesture)\r
 \r
        def _handleKeyPresses(self):\r
                """handles key presses and performs a gesture"""\r
@@ -437,7 +437,7 @@ connection could not be established"""
                                except:\r
                                        return\r
                        s = brl_poll(self._dev)\r
-                       if(len(s)):\r
+                       if s:\r
                                self._repeatcount=0\r
                                ig = InputGesture(s,self)\r
                                self.executeGesture(ig)\r