-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.py
31 lines (26 loc) · 875 Bytes
/
test.py
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
# To run script and start an interactive session (REPL):
# $ python -i test.py --host=http://checkboxmini.local:5000
from checkbox import Ping, Config, Keyboard, Mouse, MouseKeys, Screenshot, Video, Touch
import argparse
parser = argparse.ArgumentParser(formatter_class=argparse.RawTextHelpFormatter)
parser.add_argument('--host',
help="host of the Checkbox API server\n" + \
"default host is http://localhost:5000\n" + \
"example:\n python test.py --host=http://locahost:5000")
args = parser.parse_args()
if args.host:
host = args.host
else:
host = "http://localhost:5000"
print("Using API host: %s" % host)
# Class init
c = Config(host)
k = Keyboard(host)
p = Ping(host)
m = Mouse(host)
mk = MouseKeys(host)
s = Screenshot(host)
v = Video(host)
t = Touch(host)
# Shortcuts
ping = p.ping