Skip to content

Commit 68eab43

Browse files
committed
Merge pull request #27 from ddemidov/master
Button.check_buttons checks for strict match
2 parents 762cda9 + 4c813a9 commit 68eab43

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

ev3dev.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1825,15 +1825,7 @@ def any(self):
18251825
return bool(self.buttons_pressed)
18261826

18271827
def check_buttons(self,buttons=[]):
1828-
if len(buttons) == 0:
1829-
return False
1830-
s = self.buttons_pressed
1831-
if len(s) == 0:
1832-
return False
1833-
for b in buttons:
1834-
if b not in s:
1835-
return False
1836-
return True
1828+
return set(self.buttons_pressed) == set(buttons)
18371829

18381830
if current_platform() == 'ev3':
18391831
#~autogen button-property platforms.ev3.button>currentClass

0 commit comments

Comments
 (0)