forked from Wikidepia/crawlingathome-worker
-
Notifications
You must be signed in to change notification settings - Fork 5
/
crawlingathome.py
38 lines (33 loc) · 1.54 KB
/
crawlingathome.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
32
33
34
35
36
37
38
import argparse
if __name__ == '__main__':
parser = argparse.ArgumentParser(
description='Crawling@Home Worker Script'
)
parser.add_argument('--name', '-n', type=str,
default='ARKseal', help='Your name')
parser.add_argument('--url', '-u', type=str,
default='http://cah.io.community/', help='The Crawling Server')
parser.add_argument('--debug', '-d', action='store_true',
help='Add additional prints to debug code')
parser.add_argument('--notebook', '-b', action='store_true',
help='Use tqdm.notebook module for notebooks')
parser.add_argument('--docker', '-k', action='store_true',
help='Check docker version for latest image')
group = parser.add_mutually_exclusive_group()
group.add_argument('--hybrid', '-y', action='store_true',
help='Run the hybrid worker (default)')
group.add_argument('--cpu', '-c', action='store_true',
help='Run the cpu worker')
group.add_argument('--gpu', '-g', action='store_true',
help='Run the gpu worker')
args = parser.parse_args()
if args.cpu:
import cpu
cpu.main(args.name, args.url, args.debug, args.notebook, args.docker)
elif args.gpu:
import gpu
gpu.main(args.name, args.url, args.debug, args.notebook, args.docker)
else:
import hybrid
hybrid.main(args.name, args.url, args.debug,
args.notebook, args.docker)