summaryrefslogtreecommitdiff
path: root/test-cli/test/helpers
diff options
context:
space:
mode:
Diffstat (limited to 'test-cli/test/helpers')
-rw-r--r--test-cli/test/helpers/qrreader.py40
1 files changed, 19 insertions, 21 deletions
diff --git a/test-cli/test/helpers/qrreader.py b/test-cli/test/helpers/qrreader.py
index 908c9db..744db54 100644
--- a/test-cli/test/helpers/qrreader.py
+++ b/test-cli/test/helpers/qrreader.py
@@ -13,18 +13,17 @@ qrdevice_list = [
"SM SM-2D PRODUCT HID KBW"
]
-
-qrkey_list = { 'KEY_0':'0',
- 'KEY_1':'1',
- 'KEY_2':'2',
- 'KEY_3':'3',
- 'KEY_4':'4',
- 'KEY_5':'5',
- 'KEY_6':'6',
- 'KEY_7':'7',
- 'KEY_8':'8',
- 'KEY_9':'9'
- }
+qrkey_list = {'KEY_0': '0',
+ 'KEY_1': '1',
+ 'KEY_2': '2',
+ 'KEY_3': '3',
+ 'KEY_4': '4',
+ 'KEY_5': '5',
+ 'KEY_6': '6',
+ 'KEY_7': '7',
+ 'KEY_8': '8',
+ 'KEY_9': '9'
+ }
class QRReader:
@@ -41,13 +40,13 @@ class QRReader:
for device in devices:
if device.name in qrdevice_list:
self.__myReader['NAME'] = device.name
- #print(self.__myReader['NAME'])
+ # print(self.__myReader['NAME'])
self.__myReader['PATH'] = device.path
- #print(self.__myReader['PATH'])
+ # print(self.__myReader['PATH'])
self.__myReader['PHYS'] = device.phys
- #print(self.__myReader['PHYS'])
+ # print(self.__myReader['PHYS'])
- def IsQR (self):
+ def IsQR(self):
return 'NAME' in self.__myReader
def getQRNumber(self):
@@ -84,7 +83,7 @@ class QRReader:
return True
return False
- def wait_event (self, timeout):
+ def wait_event(self, timeout):
selector.register(self.__dev, selectors.EVENT_READ)
while True:
events = selector.select(timeout);
@@ -114,8 +113,7 @@ class QRReader:
return r
return False
-
-#qr = QRReader()
-#if qr.openQR():
+# qr = QRReader()
+# if qr.openQR():
# print(qr.readQRasync(2))
-#qr.closeQR()
+# qr.closeQR()