forked from M-Labs/artiq
kasli_tester: add support for windows platform. (#1204)
This commit is contained in:
parent
6aa341bc44
commit
cc143d5fec
|
@ -1,8 +1,12 @@
|
||||||
import sys
|
import sys
|
||||||
|
import os
|
||||||
import select
|
import select
|
||||||
|
|
||||||
from artiq.experiment import *
|
from artiq.experiment import *
|
||||||
|
|
||||||
|
if os.name == "nt":
|
||||||
|
import msvcrt
|
||||||
|
|
||||||
|
|
||||||
def chunker(seq, size):
|
def chunker(seq, size):
|
||||||
res = []
|
res = []
|
||||||
|
@ -16,11 +20,17 @@ def chunker(seq, size):
|
||||||
|
|
||||||
|
|
||||||
def is_enter_pressed() -> TBool:
|
def is_enter_pressed() -> TBool:
|
||||||
if select.select([sys.stdin,], [], [], 0.0)[0]:
|
if os.name == "nt":
|
||||||
sys.stdin.read(1)
|
if msvcrt.kbhit() and msvcrt.getch() == b"\r":
|
||||||
return True
|
return True
|
||||||
|
else:
|
||||||
|
return False
|
||||||
else:
|
else:
|
||||||
return False
|
if select.select([sys.stdin, ], [], [], 0.0)[0]:
|
||||||
|
sys.stdin.read(1)
|
||||||
|
return True
|
||||||
|
else:
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
class KasliTester(EnvExperiment):
|
class KasliTester(EnvExperiment):
|
||||||
|
|
Loading…
Reference in New Issue