-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathhapi_proxy.py
More file actions
executable file
·42 lines (25 loc) · 802 Bytes
/
hapi_proxy.py
File metadata and controls
executable file
·42 lines (25 loc) · 802 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/python -i
import acq400_hapi
import os
import argparse
import sys
parser = argparse.ArgumentParser(description='configure acq400_abort')
parser.add_argument('--sys', default=0, help="run in interpreter loop N times")
parser.add_argument('uut', nargs='+', help="uut")
args = parser.parse_args()
#uuts = [ acq400_hapi.Acq400(u) for u in args.uut ]
uuts = [ acq400_hapi.Acq2106(u) for u in args.uut ]
uut = uuts[0]
def sys1(cmd):
if cmd.find("=") > 0:
for u in uuts:
exec('u.{}'.format(cmd))
else:
for u in uuts:
print("%s" % (eval('u.{}'.format(cmd))))
def sys(loop = 1):
while loop:
sys1(raw_input(">"))
loop -= 1
if args.sys > 0:
sys(loop=int(args.sys))